|
| 1 | +module.exports = { |
| 2 | + parser: '@typescript-eslint/parser', // Specifies the ESLint parser |
| 3 | + parserOptions: { |
| 4 | + ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features |
| 5 | + sourceType: 'module', // Allows for the use of imports |
| 6 | + ecmaFeatures: { |
| 7 | + jsx: true, // Allows for the parsing of JSX |
| 8 | + }, |
| 9 | + }, |
| 10 | + ignorePatterns: [ |
| 11 | + 'node_modules/*', |
| 12 | + '**/node_modules/*', |
| 13 | + '.github/*', |
| 14 | + '.browser_modules/*', |
| 15 | + 'docs/*', |
| 16 | + 'scripts/*', |
| 17 | + 'electron-app/lib/*', |
| 18 | + 'electron-app/src-gen/*', |
| 19 | + 'electron-app/gen-webpack*.js', |
| 20 | + '!electron-app/webpack.config.js', |
| 21 | + 'electron-app/plugins/*', |
| 22 | + 'arduino-ide-extension/src/node/cli-protocol', |
| 23 | + '**/lib/*', |
| 24 | + ], |
| 25 | + settings: { |
| 26 | + react: { |
| 27 | + version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use |
| 28 | + }, |
| 29 | + }, |
| 30 | + extends: [ |
| 31 | + 'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin |
| 32 | + 'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react |
| 33 | + 'plugin:react-hooks/recommended', // Uses recommended rules from react hooks |
| 34 | + 'plugin:prettier/recommended', |
| 35 | + 'prettier', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier |
| 36 | + ], |
| 37 | + plugins: ['prettier', 'unused-imports'], |
| 38 | + rules: { |
| 39 | + 'prefer-const': 'off', |
| 40 | + '@typescript-eslint/no-unused-expressions': 'off', |
| 41 | + '@typescript-eslint/no-namespace': 'off', |
| 42 | + '@typescript-eslint/no-var-requires': 'off', |
| 43 | + '@typescript-eslint/no-empty-function': 'warn', |
| 44 | + '@typescript-eslint/no-empty-interface': 'warn', |
| 45 | + 'no-unused-vars': 'off', |
| 46 | + 'unused-imports/no-unused-imports': 'error', |
| 47 | + 'unused-imports/no-unused-vars': [ |
| 48 | + 'warn', |
| 49 | + { |
| 50 | + vars: 'all', |
| 51 | + varsIgnorePattern: '^_', |
| 52 | + args: 'after-used', |
| 53 | + argsIgnorePattern: '^_', |
| 54 | + }, |
| 55 | + ], |
| 56 | + 'react/display-name': 'warn', |
| 57 | + eqeqeq: ['error', 'smart'], |
| 58 | + 'guard-for-in': 'off', |
| 59 | + 'id-blacklist': 'off', |
| 60 | + 'id-match': 'off', |
| 61 | + 'no-underscore-dangle': 'off', |
| 62 | + 'no-unused-expressions': 'off', |
| 63 | + 'no-var': 'error', |
| 64 | + radix: 'error', |
| 65 | + 'prettier/prettier': 'warn', |
| 66 | + }, |
| 67 | +}; |
0 commit comments