3.0.0 • Published 3 years ago

eslint-config-forcir v3.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Install

yarn add eslint-config-forcir --dev --exact

Peer Dependencies

yarn add typescript prettier eslint jest lint-staged husky --dev --exact

.eslintrc file in project root

{
  // Can be any of: `forcir`, `forcir/backend`, `forcir/frontend`, `forcir/next`
  "extends": "forcir/backend"
}

If there are any files you want to exclude from ESLint add .eslintignore to project root

Configurations

This package includes 3 guaranteed files of shared rules.

This package also may contain up to 3 additional files that use rules or overrides considered experimental. These do not adhere to semantic versioning (SEMVER). They may be removed at any point without warning.

Next.JS Full-Stack Websites / Applications

  • forcir/next
  • forcir/next-experimental

React Frontend-only Applications

  • forcir/frontend
  • forcir/frontend-experimental

Node Backend-only APIs / Serverless

  • forcir/backend
  • forcir/backend-experimental

.prettierrc file in project root

{
  "printWidth": 120,
  "singleQuote": true
}

If there are any files you want to exclude from Prettier add .prettierignore to project root

.editorconfig file in project root

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 120
trim_trailing_whitespace = true

[*.md]
max_line_length = 0
trim_trailing_whitespace = false

[COMMIT_EDITMSG]
max_line_length = 0

[*.{yml,yaml}]
indent_size = 2

[docker-compose.yml]
indent_size = 4

Add the engines field to package.json

"engines": {
  "node": ">=16.14",
  "npm": ">=8.5.2",
  "yarn": ">=1.22.17"
}

Add linting and formatting scripts

"scripts": {
  // ...
  "format": "prettier --write \"**/*.{ts,tsx,js,json,graphql,md}\"",
  "format:check": "prettier --debug-check \"**/*.{ts,tsx,js,json,graphql,md}\"",
  "format:quick": "pretty-quick",
  "lint": "eslint .",
  "lint:staged": "lint-staged",
  "prepare": "husky install"
},

Add pre-commit husky hook

For automatically linting and formatting any files staged for commit

npx husky add .husky/pre-commit "yarn run lint:staged"

.lintstagedrc file in project root

{
  "*.{ts,tsx,js}": ["eslint --quiet", "git add"],
  "*.{ts,tsx,js,json,graphql,md}": ["prettier --write", "git add"]
}
0.0.0-e16dc54

3 years ago

0.0.0-b6d2345

3 years ago

0.0.0-2bcef8d

3 years ago

0.0.0-fc052d9

3 years ago

0.0.0-29de6b8

3 years ago

0.0.0-e82f423

3 years ago

0.0.0-7207246

3 years ago

0.0.0-5f47d19

3 years ago

0.0.0-adda498

3 years ago

0.0.0-8ceca40

3 years ago

0.0.0-0ae603f

3 years ago

0.0.0-39a9f00

3 years ago

0.0.0-fc89c4c

3 years ago

0.0.0-7414cbf

3 years ago

3.0.0

3 years ago

0.0.0-63ead54

3 years ago

0.0.0-7998788

3 years ago

2.0.1

3 years ago

0.0.0-b7f3c48

3 years ago

0.0.0-9eb4e05

3 years ago

2.0.0

3 years ago

0.0.0-5242965

3 years ago

0.0.0-7bc2c4b

3 years ago

1.2.3

3 years ago

0.0.0-4229ec4

3 years ago

0.0.0-15e3e6a

3 years ago

0.0.0-0a249fd

3 years ago

1.2.2

3 years ago

0.0.0-66997ca

3 years ago

1.2.1

3 years ago

0.0.0-6fbf622

3 years ago

0.0.0-2309436

3 years ago

0.0.0-ce751fa

3 years ago

1.2.0

3 years ago

0.0.0-1a56efb

3 years ago

0.0.0-e1d00f4

3 years ago

1.1.0

3 years ago

0.0.0-9e6c999

3 years ago

0.0.0-b5519e5

3 years ago

0.0.0-7778f49

3 years ago

0.0.0-33679a0

3 years ago

0.0.0-9e0b3f5

3 years ago

1.0.0

3 years ago

0.0.0-80f340d

3 years ago

0.0.0-734a7c1

3 years ago

0.0.1-canary.1

3 years ago

0.0.1-canary.0

3 years ago

0.0.0

3 years ago