|
| 1 | +import js from "@eslint/js" |
| 2 | +import globals from "globals" |
| 3 | +import { defineConfig } from "eslint/config" |
| 4 | + |
| 5 | +export default defineConfig([ |
| 6 | + { |
| 7 | + ignores: ['dist/**', 'jest.config.js', 'eslint.config.mjs', 'src/renderer/**',], |
| 8 | + }, |
| 9 | + { |
| 10 | + files: ["**/*.{js,mjs,cjs}"], |
| 11 | + plugins: { js }, |
| 12 | + extends: ["js/recommended"], |
| 13 | + rules: { |
| 14 | + indent: "off", |
| 15 | + quotes: ["error", "single", { avoidEscape: true }], |
| 16 | + "no-unused-vars": ["error", { args: "none", ignoreRestSiblings: true }], |
| 17 | + "no-console": "off", |
| 18 | + eqeqeq: "error", |
| 19 | + curly: "error", |
| 20 | + "no-undef": "error", |
| 21 | + "no-redeclare": "error", |
| 22 | + "consistent-return": "error", |
| 23 | + "no-shadow": "error", |
| 24 | + "object-curly-spacing": ["error", "always"], |
| 25 | + "callback-return": "error", |
| 26 | + "handle-callback-err": ["error", "^.*(e|E)rr"], |
| 27 | + "no-new-require": "error", |
| 28 | + "no-path-concat": "error", |
| 29 | + "no-process-exit": "off", |
| 30 | + "no-eval": "error", |
| 31 | + "no-implied-eval": "error", |
| 32 | + strict: "error", |
| 33 | + "no-var": "error", |
| 34 | + "prefer-const": "error", |
| 35 | + "no-empty": "error", |
| 36 | + "no-mixed-operators": "error", |
| 37 | + "no-trailing-spaces": "error", |
| 38 | + "linebreak-style": "off", |
| 39 | + "max-len": "off", |
| 40 | + "no-param-reassign": "off", |
| 41 | + "prefer-destructuring": "off", |
| 42 | + "prefer-arrow-callback": "off", |
| 43 | + "func-names": "error", |
| 44 | + "arrow-parens": "off", |
| 45 | + "dot-notation": "off", |
| 46 | + "import/prefer-default-export": "off", |
| 47 | + "import/first": "off", |
| 48 | + "no-template-curly-in-string": "off", |
| 49 | + "new-cap": ["error", { capIsNew: false }], |
| 50 | + "array-callback-return": "error", |
| 51 | + "object-shorthand": ["error", "consistent"], |
| 52 | + "function-paren-newline": ["error", "consistent"], |
| 53 | + "quote-props": ["error", "as-needed"], |
| 54 | + "operator-linebreak": ["error", "before"], |
| 55 | + "prefer-template": "error", |
| 56 | + "id-length": "error", |
| 57 | + "newline-before-return": "error", |
| 58 | + "space-before-blocks": "error", |
| 59 | + "eol-last": ["error", "always"], |
| 60 | + "no-multiple-empty-lines": ["error", { max: 1, maxEOF: 1 }] |
| 61 | + } |
| 62 | + }, |
| 63 | + { |
| 64 | + files: ["**/*.js"], |
| 65 | + languageOptions: { sourceType: "commonjs" } |
| 66 | + }, |
| 67 | + { |
| 68 | + files: ["**/*.{js,mjs,cjs}"], |
| 69 | + languageOptions: { |
| 70 | + globals: { |
| 71 | + ...globals.browser, |
| 72 | + ...globals.node, |
| 73 | + ...globals.jest |
| 74 | + } |
| 75 | + } |
| 76 | + } |
| 77 | +]) |
0 commit comments