## Description Disable CRA built-in ESLint checks since we have our own config and a separate step for this #### Type of change - Chore (housekeeping or task changes that don't impact user perception) ## Testing > #### How Has This Been Tested? > Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration. > Delete anything that is not relevant - [x] Manual - [ ] Jest - [ ] Cypress ## Checklist: #### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag Co-authored-by: Valera Melnikov <melnikov.vv@greendatasoft.ru>
96 lines
3.8 KiB
JSON
96 lines
3.8 KiB
JSON
// This file is a base for all package-specific ESLint configurations
|
||
{
|
||
"$schema": "http://json.schemastore.org/eslintrc",
|
||
"root": true,
|
||
"parser": "@typescript-eslint/parser",
|
||
"plugins": [
|
||
"react",
|
||
"@typescript-eslint",
|
||
"prettier",
|
||
"react-hooks",
|
||
"sort-destructure-keys",
|
||
"cypress",
|
||
"jest"
|
||
],
|
||
"extends": [
|
||
"plugin:react/recommended", // Uses the recommended rules from @eslint-plugin-react
|
||
"plugin:@typescript-eslint/recommended",
|
||
"plugin:cypress/recommended",
|
||
// Note: Please keep this as the last config to make sure that this (and by extension our .prettierrc file) overrides all configuration above it
|
||
// https://www.npmjs.com/package/eslint-plugin-prettier#recommended-configuration
|
||
"plugin:prettier/recommended"
|
||
],
|
||
"parserOptions": {
|
||
"ecmaVersion": 2020, // Allows for the parsing of modern ECMAScript features
|
||
"sourceType": "module", // Allows for the use of imports
|
||
"ecmaFeatures": {
|
||
"jsx": true // Allows for the parsing of JSX
|
||
}
|
||
},
|
||
"rules": {
|
||
"@typescript-eslint/no-explicit-any": "off",
|
||
"@typescript-eslint/no-use-before-define": "off",
|
||
"@typescript-eslint/no-var-requires": "off",
|
||
"import/no-webpack-loader-syntax": "off",
|
||
"no-undef": "off",
|
||
"react/prop-types": "off",
|
||
"react/display-name": "off",
|
||
"@typescript-eslint/explicit-module-boundary-types": "off",
|
||
"cypress/no-unnecessary-waiting": "off",
|
||
"cypress/no-assigning-return-values": "off",
|
||
"@typescript-eslint/no-unused-vars": "error",
|
||
"jest/no-focused-tests": "error",
|
||
"jest/no-disabled-tests": "error",
|
||
// enforce `import type` for all type-only imports so the bundler knows to erase them
|
||
"@typescript-eslint/consistent-type-imports": "error",
|
||
"react-hooks/rules-of-hooks": "error",
|
||
"react/jsx-boolean-value": "error",
|
||
"react/self-closing-comp": "error",
|
||
"react/jsx-sort-props": "error",
|
||
"react/jsx-fragments": "error",
|
||
"react/jsx-no-useless-fragment": "error",
|
||
"sort-destructure-keys/sort-destructure-keys": [
|
||
"error",
|
||
{ "caseSensitive": false }
|
||
],
|
||
"no-console": "error",
|
||
"no-debugger": "error",
|
||
"@typescript-eslint/no-restricted-imports": [
|
||
"error",
|
||
{
|
||
"patterns": [
|
||
{
|
||
"group": ["@blueprintjs/core/lib/esnext/*"],
|
||
"message": "Reason: @blueprintjs/core has both lib/esnext and lib/esm directories which export the same components. To avoid duplicating components in the bundle, please import only from the lib/esm directory."
|
||
},
|
||
{
|
||
"group": ["*.svg"],
|
||
"importNames": ["ReactComponent"],
|
||
"message": "Reason: Please don’t import SVG icons statically. (They won’t always be needed, but they *will* always be present in the bundle and will increase the bundle size.) Instead, please either import them as SVG paths (e.g. import starIconUrl from './star.svg'), or use the importSvg wrapper from design-system-old (e.g. const StarIcon = importSvg(() => import('./star.svg')))."
|
||
},
|
||
{
|
||
"group": ["remixicon-react/*"],
|
||
"message": "Reason: Please don’t import Remix icons statically. (They won’t always be needed, but they *will* always be present in the bundle and will increase the bundle size.) Instead, please use the importRemixIcon wrapper from design-system-old (e.g. const StarIcon = importRemixIcon(() => import('remixicon-react/Star')))."
|
||
}
|
||
]
|
||
}
|
||
]
|
||
},
|
||
"settings": {
|
||
"import/resolver": {
|
||
"babel-module": {}
|
||
},
|
||
"react": {
|
||
"pragma": "React",
|
||
// Tells eslint-plugin-react to automatically detect the version of React to use
|
||
"version": "detect"
|
||
}
|
||
},
|
||
"env": {
|
||
"browser": true,
|
||
"node": true,
|
||
"cypress/globals": true,
|
||
"worker": true
|
||
}
|
||
}
|