oneuptime/.eslintrc.json
2022-05-16 18:38:12 +01:00

178 lines
5.3 KiB
JSON

{
"parserOptions": {
"ecmaVersion": 8,
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true,
"spread": true
},
"sourceType": "module",
"project": [
"./tsconfig.json"
]
},
"env": {
"browser": true,
"node": true,
"jquery": true,
"es6": true,
"jest": true,
"jasmine": true
},
"plugins": [
"react",
"jsx-a11y",
"progress",
"@typescript-eslint",
"unused-imports"
],
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:prettier/recommended",
"prettier"
],
"globals": {
"describe": true,
"context": true,
"before": true,
"beforeEach": true,
"after": true,
"afterEach": true,
"it": true,
"expect": true,
"workbox": true,
"importScripts": true,
"$TSFixMe": true
},
"parser": "@typescript-eslint/parser",
"rules": {
"no-fallthrough": "error",
"no-unreachable": "error",
"no-cond-assign": "error",
"valid-typeof": "error",
"no-func-assign": "error",
"curly": "error",
"no-extra-semi": "error",
"no-else-return": "error",
"no-div-regex": "error",
"no-octal": "error",
"no-extra-bind": "error",
"unicode-bom": "error",
"no-extra-boolean-cast": "error",
"wrap-regex": "error",
"wrap-iife": "error",
"yield-star-spacing": "error",
"no-implicit-coercion": "error",
"no-extra-label": "error",
"multiline-comment-style": "error",
"no-lonely-if": "error",
"no-floating-decimal": "error",
"eqeqeq": "error",
"dot-notation": "off", // Off because it messes up with typescript compiler.
"@typescript-eslint/dot-notation": "off", //temp off.
"progress/activate": 1,
"linebreak-style": [
"error",
"unix"
],
// https://www.npmjs.com/package/eslint-plugin-unused-imports
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/await-thenable":"error",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"error",
{
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_"
}
],
"@typescript-eslint/explicit-member-accessibility": [
"error"
],
"no-console": "error",
"no-undef": "error",
"no-empty": "error",
"prefer-arrow-callback": "error",
"constructor-super": "error",
"no-case-declarations": "error",
"no-mixed-spaces-and-tabs": "error",
"no-useless-escape": "error",
"prettier/prettier": "error",
"react/jsx-no-undef": "error",
"react/jsx-no-bind": [
"error",
{
"allowArrowFunctions": true,
"allowBind": false,
"ignoreRefs": false
}
],
"react/no-children-prop": "error",
"react/no-deprecated": "error",
"react/boolean-prop-naming": "error",
"react/no-is-mounted": "error",
"react/no-find-dom-node": "error",
"one-var-declaration-per-line": "error",
"arrow-parens": "error",
"arrow-body-style": [
"error",
"always"
],
"@typescript-eslint/typedef": [
"error",
{
"arrowParameter": true,
"variableDeclaration": true
}
],
"@typescript-eslint/strict-boolean-expressions": "off", //Need to enable this very soon
"@typescript-eslint/explicit-function-return-type": [
"error",
{
"allowExpressions": true
}
],
"react/no-did-update-set-state": "error",
"react/no-unknown-property": "error",
"react/no-unused-prop-types": "error",
"react/jsx-no-duplicate-props": "error",
"react/no-unused-state": "error",
"react/jsx-uses-vars": "error",
"react/prop-types": "error",
"react/react-in-jsx-scope": "error",
"react/no-string-refs": "error",
"jsx-a11y/href-no-hash": [
0
],
"react/no-unescaped-entities": "error",
"react/display-name": "error",
"react/jsx-pascal-case": "error",
"array-callback-return": "error",
"no-loop-func": "error",
"no-duplicate-imports": "error", /// Enable this and fix errors.
"no-promise-executor-return": "error",
"capitalized-comments": "off", // turn this on after ts-migration.
"for-direction": "error",
"getter-return": "error",
"jsx-a11y/anchor-is-valid": "error",
"no-async-promise-executor": "error",
"prefer-const": [
"error",
{
"destructuring": "any",
"ignoreReadBeforeAssign": false
}
],
"no-var": "error"
},
"settings": {
"react": {
"version": "16.5"
}
}
}