Add eslint, stylelint, prettier, and pre-commit (#484)
- When you try to commit, Pre-commit will run checks for all three, if
installed, _only_ on staged files, and prevent committing if the linters are
unhappy.
- Several eslint rules that generate a lot of errors are disabled for now.
That's to allow a more gradual transition, so you won't change 1 line and be
told to fix 100 other lines (but maybe like 20 because there are still a lot
of rules enabled).
- Prettier is set to require pragma. That's also to allow a more gradual
transition. As each file is tidied up, run Prettier on it, and it'll add a
special comment that tells it that it's now responsible for keeping that one
tidy.
2020-12-23 11:45:53 +03:00
|
|
|
{
|
2024-08-13 11:39:35 +03:00
|
|
|
"root": true,
|
2021-01-07 16:24:59 +03:00
|
|
|
"env": {
|
2023-03-28 21:06:37 +03:00
|
|
|
"browser": true,
|
2024-08-15 12:27:22 +03:00
|
|
|
"es6": true,
|
|
|
|
"jest/globals": true
|
2021-01-07 16:24:59 +03:00
|
|
|
},
|
2024-08-15 12:27:22 +03:00
|
|
|
"plugins": ["import", "jest"],
|
2024-08-05 19:22:56 +03:00
|
|
|
"extends": [
|
|
|
|
"eslint:recommended",
|
2024-08-13 11:39:35 +03:00
|
|
|
"plugin:@typescript-eslint/recommended",
|
2024-08-15 12:27:22 +03:00
|
|
|
"plugin:jest/recommended",
|
2024-08-05 19:22:56 +03:00
|
|
|
"plugin:jsx-a11y/recommended",
|
2021-10-11 15:48:19 +03:00
|
|
|
"plugin:react/recommended",
|
2024-07-10 17:02:05 +03:00
|
|
|
"plugin:react-hooks/recommended",
|
2021-10-11 15:48:19 +03:00
|
|
|
"prettier"
|
|
|
|
],
|
Add eslint, stylelint, prettier, and pre-commit (#484)
- When you try to commit, Pre-commit will run checks for all three, if
installed, _only_ on staged files, and prevent committing if the linters are
unhappy.
- Several eslint rules that generate a lot of errors are disabled for now.
That's to allow a more gradual transition, so you won't change 1 line and be
told to fix 100 other lines (but maybe like 20 because there are still a lot
of rules enabled).
- Prettier is set to require pragma. That's also to allow a more gradual
transition. As each file is tidied up, run Prettier on it, and it'll add a
special comment that tells it that it's now responsible for keeping that one
tidy.
2020-12-23 11:45:53 +03:00
|
|
|
"rules": {
|
2024-08-13 11:39:35 +03:00
|
|
|
"import/no-unresolved": "error",
|
Add eslint, stylelint, prettier, and pre-commit (#484)
- When you try to commit, Pre-commit will run checks for all three, if
installed, _only_ on staged files, and prevent committing if the linters are
unhappy.
- Several eslint rules that generate a lot of errors are disabled for now.
That's to allow a more gradual transition, so you won't change 1 line and be
told to fix 100 other lines (but maybe like 20 because there are still a lot
of rules enabled).
- Prettier is set to require pragma. That's also to allow a more gradual
transition. As each file is tidied up, run Prettier on it, and it'll add a
special comment that tells it that it's now responsible for keeping that one
tidy.
2020-12-23 11:45:53 +03:00
|
|
|
"react/destructuring-assignment": [0],
|
|
|
|
"react/prop-types": [0],
|
|
|
|
"max-classes-per-file": [0],
|
2021-10-11 15:48:19 +03:00
|
|
|
"react/display-name": [0],
|
Add eslint, stylelint, prettier, and pre-commit (#484)
- When you try to commit, Pre-commit will run checks for all three, if
installed, _only_ on staged files, and prevent committing if the linters are
unhappy.
- Several eslint rules that generate a lot of errors are disabled for now.
That's to allow a more gradual transition, so you won't change 1 line and be
told to fix 100 other lines (but maybe like 20 because there are still a lot
of rules enabled).
- Prettier is set to require pragma. That's also to allow a more gradual
transition. As each file is tidied up, run Prettier on it, and it'll add a
special comment that tells it that it's now responsible for keeping that one
tidy.
2020-12-23 11:45:53 +03:00
|
|
|
"react/jsx-one-expression-per-line": [0],
|
2021-01-07 16:24:59 +03:00
|
|
|
"react/self-closing-comp": [0],
|
2021-07-21 16:50:26 +03:00
|
|
|
"no-unused-expressions": [1, { "allowShortCircuit": true }],
|
2024-08-13 11:39:35 +03:00
|
|
|
"@typescript-eslint/no-unused-vars": [
|
|
|
|
2,
|
|
|
|
{
|
|
|
|
"args": "all",
|
|
|
|
"argsIgnorePattern": "^_",
|
|
|
|
"caughtErrors": "all",
|
|
|
|
"caughtErrorsIgnorePattern": "^_",
|
|
|
|
"destructuredArrayIgnorePattern": "^_",
|
|
|
|
"varsIgnorePattern": "^_",
|
|
|
|
"ignoreRestSiblings": true
|
|
|
|
}
|
|
|
|
],
|
2021-11-23 12:39:09 +03:00
|
|
|
"no-prototype-builtins": [0],
|
|
|
|
"react/jsx-props-no-spreading": [0],
|
2021-07-21 16:50:26 +03:00
|
|
|
"jsx-a11y/click-events-have-key-events": [0],
|
2021-09-27 17:16:25 +03:00
|
|
|
"jsx-a11y/no-static-element-interactions": [0],
|
2023-06-01 16:26:23 +03:00
|
|
|
"react/no-did-update-set-state": [0],
|
2024-08-13 11:39:35 +03:00
|
|
|
"react/no-unknown-property": [2, { "ignore": ["tooltip"] }]
|
2021-10-11 15:48:19 +03:00
|
|
|
},
|
|
|
|
"settings": {
|
2024-08-13 11:39:35 +03:00
|
|
|
"import/parsers": {
|
|
|
|
"@typescript-eslint/parser": [".ts", ".tsx"]
|
|
|
|
},
|
|
|
|
"import/resolver": {
|
|
|
|
"typescript": {
|
|
|
|
"alwaysTryTypes": true // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
|
|
|
|
}
|
|
|
|
},
|
2021-10-11 15:48:19 +03:00
|
|
|
"react": {
|
|
|
|
"createClass": "createReactClass", // Regex for Component Factory to use,
|
2024-08-13 11:39:35 +03:00
|
|
|
// default to "createReactClass"
|
|
|
|
"pragma": "React", // Pragma to use, default to "React"
|
|
|
|
"fragment": "Fragment", // Fragment to use (may be a property of <pragma>), default to "Fragment"
|
2021-10-11 15:48:19 +03:00
|
|
|
"version": "detect"
|
|
|
|
}
|
Add eslint, stylelint, prettier, and pre-commit (#484)
- When you try to commit, Pre-commit will run checks for all three, if
installed, _only_ on staged files, and prevent committing if the linters are
unhappy.
- Several eslint rules that generate a lot of errors are disabled for now.
That's to allow a more gradual transition, so you won't change 1 line and be
told to fix 100 other lines (but maybe like 20 because there are still a lot
of rules enabled).
- Prettier is set to require pragma. That's also to allow a more gradual
transition. As each file is tidied up, run Prettier on it, and it'll add a
special comment that tells it that it's now responsible for keeping that one
tidy.
2020-12-23 11:45:53 +03:00
|
|
|
}
|
|
|
|
}
|