analytics/assets/.eslintrc.json
Artur Pata 039f3baf8e
Add Typescript (#4427)
* Add typescript, rewrite Countries map

* Add back DB IP geolocation notice

* Silence all current eslint warnings: to be removed gradually

* Reconfigure eslint import plugin for typescript

* Insert formatting pragma by default, but ignore files without pragma in CI
2024-08-13 11:39:35 +03:00

62 lines
1.9 KiB
JSON

{
"root": true,
"env": {
"browser": true,
"es6": true
},
"plugins": ["import"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:jsx-a11y/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"prettier"
],
"rules": {
"import/no-unresolved": "error",
"react/destructuring-assignment": [0],
"react/prop-types": [0],
"max-classes-per-file": [0],
"react/display-name": [0],
"react/jsx-one-expression-per-line": [0],
"react/self-closing-comp": [0],
"no-unused-expressions": [1, { "allowShortCircuit": true }],
"@typescript-eslint/no-unused-vars": [
2,
{
"args": "all",
"argsIgnorePattern": "^_",
"caughtErrors": "all",
"caughtErrorsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"ignoreRestSiblings": true
}
],
"no-prototype-builtins": [0],
"react/jsx-props-no-spreading": [0],
"jsx-a11y/click-events-have-key-events": [0],
"jsx-a11y/no-static-element-interactions": [0],
"react/no-did-update-set-state": [0],
"react/no-unknown-property": [2, { "ignore": ["tooltip"] }]
},
"settings": {
"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`
}
},
"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"
}
}
}