2021-04-12 13:32:25 +00:00
|
|
|
var path = require("path");
|
2016-09-06 18:41:16 +00:00
|
|
|
module.exports = {
|
2020-12-01 18:15:12 +00:00
|
|
|
extends: [
|
2021-04-12 13:32:25 +00:00
|
|
|
"airbnb",
|
|
|
|
"plugin:jest/recommended",
|
|
|
|
"plugin:react-hooks/recommended",
|
|
|
|
"plugin:@typescript-eslint/recommended",
|
|
|
|
"plugin:prettier/recommended",
|
2023-05-03 16:50:17 +00:00
|
|
|
"plugin:storybook/recommended",
|
2016-09-06 18:41:16 +00:00
|
|
|
],
|
2021-04-12 13:32:25 +00:00
|
|
|
parser: "@typescript-eslint/parser",
|
|
|
|
plugins: ["jest", "react", "@typescript-eslint"],
|
2016-09-06 18:41:16 +00:00
|
|
|
env: {
|
2021-03-01 07:48:51 +00:00
|
|
|
node: true,
|
|
|
|
mocha: true,
|
|
|
|
browser: true,
|
2021-04-12 13:32:25 +00:00
|
|
|
"jest/globals": true,
|
2016-09-06 18:41:16 +00:00
|
|
|
},
|
|
|
|
globals: {
|
2021-03-01 07:48:51 +00:00
|
|
|
expect: false,
|
|
|
|
describe: false,
|
2016-09-06 18:41:16 +00:00
|
|
|
},
|
|
|
|
rules: {
|
2021-04-12 13:32:25 +00:00
|
|
|
camelcase: "off",
|
|
|
|
"consistent-return": 1,
|
|
|
|
"arrow-body-style": 0,
|
|
|
|
"max-len": 0,
|
|
|
|
"no-unused-expressions": 0,
|
|
|
|
"no-console": 0,
|
|
|
|
"space-before-function-paren": 0,
|
|
|
|
"react/prefer-stateless-function": 0,
|
|
|
|
"react/no-multi-comp": 0,
|
|
|
|
"react/no-unused-prop-types": [
|
|
|
|
1,
|
2023-05-03 16:50:17 +00:00
|
|
|
{
|
|
|
|
customValidators: [],
|
|
|
|
skipShapeProps: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
"react/require-default-props": 0,
|
|
|
|
// TODO set default props and enable this check
|
|
|
|
"react/jsx-filename-extension": [
|
|
|
|
1,
|
|
|
|
{
|
|
|
|
extensions: [".jsx", ".tsx"],
|
|
|
|
},
|
2021-04-12 13:32:25 +00:00
|
|
|
],
|
2022-09-06 14:02:10 +00:00
|
|
|
"react-hooks/exhaustive-deps": 1,
|
2021-04-12 13:32:25 +00:00
|
|
|
"no-param-reassign": 0,
|
|
|
|
"new-cap": 0,
|
2023-05-03 16:50:17 +00:00
|
|
|
"import/no-unresolved": [
|
|
|
|
2,
|
|
|
|
{
|
|
|
|
caseSensitive: false,
|
|
|
|
},
|
|
|
|
],
|
2021-04-12 13:32:25 +00:00
|
|
|
"linebreak-style": 0,
|
|
|
|
"import/no-named-as-default": "off",
|
|
|
|
"import/no-named-as-default-member": "off",
|
|
|
|
"import/extensions": 0,
|
|
|
|
"import/no-extraneous-dependencies": 0,
|
|
|
|
"no-underscore-dangle": 0,
|
|
|
|
"jsx-a11y/no-static-element-interactions": "off",
|
2021-03-01 07:48:51 +00:00
|
|
|
// note you must disable the base rule as it can report incorrect errors. more info here:
|
|
|
|
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-use-before-define.md
|
2021-04-12 13:32:25 +00:00
|
|
|
"no-use-before-define": "off",
|
|
|
|
"@typescript-eslint/no-use-before-define": ["error"],
|
2021-03-01 07:48:51 +00:00
|
|
|
// turn off and override to not run this on js and jsx files. More info here:
|
|
|
|
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md#configuring-in-a-mixed-jsts-codebase
|
2021-04-12 13:32:25 +00:00
|
|
|
"@typescript-eslint/explicit-module-boundary-types": "off",
|
2021-03-24 13:18:56 +00:00
|
|
|
// Most of the js modules written by us need to be rewritten into TS. Until then
|
|
|
|
// we use ts-ignore comment to ignore the error TS gives us from not having those modules
|
|
|
|
// declared (TS7016). This is done on purpose as there is not time to rewrite everything in TS.
|
2022-08-02 08:54:20 +00:00
|
|
|
"@typescript-eslint/ban-ts-comment": "off",
|
2023-05-03 16:50:17 +00:00
|
|
|
"no-shadow": "off",
|
|
|
|
// replaced by ts-eslint rule below
|
2022-08-02 08:54:20 +00:00
|
|
|
"@typescript-eslint/no-shadow": "error",
|
2021-03-01 07:48:51 +00:00
|
|
|
// There is a bug with these rules in our version of jsx-a11y plugin (5.1.1)
|
|
|
|
// To upgrade our version of the plugin we would need to make more changes
|
|
|
|
// with eslint-config-airbnb, so we will just turn off for now.
|
2021-04-12 13:32:25 +00:00
|
|
|
"jsx-a11y/heading-has-content": "off",
|
|
|
|
"jsx-a11y/anchor-has-content": "off",
|
2016-09-06 18:41:16 +00:00
|
|
|
},
|
2021-03-01 07:48:51 +00:00
|
|
|
overrides: [
|
|
|
|
],
|
2016-09-06 18:41:16 +00:00
|
|
|
settings: {
|
2021-04-12 13:32:25 +00:00
|
|
|
"import/resolver": {
|
2016-09-06 18:41:16 +00:00
|
|
|
webpack: {
|
2021-04-12 13:32:25 +00:00
|
|
|
config: path.join(__dirname, "webpack.config.js"),
|
2021-03-01 07:48:51 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|