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
|
|
|
{
|
2021-01-07 16:24:59 +03:00
|
|
|
"env": {
|
|
|
|
"browser": true
|
|
|
|
},
|
2021-10-11 15:48:19 +03:00
|
|
|
"extends": ["eslint:recommended",
|
|
|
|
"plugin:react/recommended",
|
|
|
|
"prettier"
|
|
|
|
],
|
|
|
|
"parser": "babel-eslint",
|
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
|
|
|
"plugins": ["prettier"],
|
|
|
|
"rules": {
|
2021-07-21 16:50:26 +03:00
|
|
|
"max-len": [0, {"code": 120}],
|
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
|
|
|
"prettier/prettier": [2],
|
|
|
|
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
|
|
|
|
"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 }],
|
|
|
|
"no-unused-vars": [2, { "varsIgnorePattern": "^_", "argsIgnorePattern": "^_" }],
|
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],
|
|
|
|
"react/no-did-update-set-state": [0]
|
2021-10-11 15:48:19 +03:00
|
|
|
},
|
|
|
|
"settings": {
|
|
|
|
"react": {
|
|
|
|
"createClass": "createReactClass", // Regex for Component Factory to use,
|
|
|
|
// 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"
|
|
|
|
"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
|
|
|
}
|
|
|
|
}
|