.eslintrc
// Use this file as a starting point for your project"s .eslintrc.
// Copy this file, and add rule overrides as needed.
// the base style guide for this project is Airbnb
// see: https://github.com/airbnb/javascript
{
"extends": [
"airbnb"
],
"env": {
"es6": true,
"jasmine": true,
"jest": true
},
"globals": {
"window": true,
"document": true,
"localStorage": true,
"sessionStorage": true,
"Blob": true,
"Image": true,
"System": true,
"__COMMIT_HASH__": "readonly"
},
"parser": "babel-eslint",
"parserOptions": {
"allowImportExportEverywhere": true,
"ecmaVersion": 6,
"ecmaFeatures": {
"jsx": true
}
},
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"],
"paths": ["src"],
"moduleDirectory": [
"node_modules",
"src/js"
]
}
}
},
"plugins": [
"no-loops"
],
// overrides to the Airbnb style follow
"rules": {
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
}
],
"react/jsx-filename-extension": 0,
"no-loops/no-loops": 2,
"sort-imports": ["error", {
"ignoreDeclarationSort": true
}],
"max-len": [0],
"linebreak-style": [0],
"react/jsx-uses-react": [0],
"react/react-in-jsx-scope": [0],
"arrow-parens": [0],
"camelcase": [0], // only because of UNSAFE_ react lifecycle methods
"react/jsx-no-target-blank": [0],
"react/prop-types": ["warn"],
"template-curly-spacing" : "off",
"indent": ["error", 2, { "ignoredNodes": ["JSXAttribute", "JSXSpreadAttribute", "TemplateLiteral"], "SwitchCase": 1 }],
"react/jsx-indent": [0],
"react/jsx-indent-props": ["error", 2],
"complexity": ["warn", { "max": 40 }],
"no-confusing-arrow": [0],
// allow names to be the same as the default for Redux container testing
"import/no-named-as-default": [0],
// allow test files to import packages in devDependencies
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md
"import/no-extraneous-dependencies": ["error", {
"devDependencies": [
"**/*.test.js?(x)",
"/src/testUtilities/**/*"
]
}]
},
"overrides": [
{
"files": ["**/*.ts", "**/*.tsx"],
"parser": "@typescript-eslint/parser",
"extends": [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"@typescript-eslint/ban-ts-comment": [0],
"react/prop-types": [0],
"@typescript-eslint/no-var-requires": [0],
"no-use-before-define": [0],
"@typescript-eslint/no-use-before-define": ["error"]
},
"plugins": ["react", "@typescript-eslint"],
},
{
"files": ["**/*.js", "**/*.jsx"],
"rules": {
"@typescript-eslint/*": "off"
}
}
]
}