|
| 1 | +const js = require("@eslint/js"); |
| 2 | +const n = require("eslint-plugin-n"); |
| 3 | +const prettierPlugin = require("eslint-plugin-prettier"); |
| 4 | +const prettierConfig = require("eslint-config-prettier"); |
| 5 | + |
| 6 | +module.exports = [ |
| 7 | + js.configs.recommended, |
| 8 | + n.configs["flat/recommended-script"], |
| 9 | + { |
| 10 | + plugins: { |
| 11 | + prettier: prettierPlugin, |
| 12 | + n, |
| 13 | + }, |
| 14 | + |
| 15 | + languageOptions: { |
| 16 | + ecmaVersion: 2021, |
| 17 | + sourceType: "script", |
| 18 | + }, |
| 19 | + |
| 20 | + rules: { |
| 21 | + ...prettierConfig.rules, |
| 22 | + "prettier/prettier": "error", |
| 23 | + "no-undef": "error", |
| 24 | + "no-extra-semi": "error", |
| 25 | + "no-template-curly-in-string": "error", |
| 26 | + "no-caller": "error", |
| 27 | + "no-control-regex": "off", |
| 28 | + "no-async-promise-executor": "off", |
| 29 | + yoda: "error", |
| 30 | + eqeqeq: "error", |
| 31 | + "brace-style": "off", |
| 32 | + "eol-last": "error", |
| 33 | + "no-extra-bind": "warn", |
| 34 | + "no-use-before-define": "off", |
| 35 | + "no-unused-vars": ["error", { args: "none" }], |
| 36 | + "no-unsafe-negation": "error", |
| 37 | + "no-loop-func": "warn", |
| 38 | + indent: "off", |
| 39 | + "no-console": "off", |
| 40 | + "n/global-require": "off", |
| 41 | + "n/no-process-exit": "error", |
| 42 | + "n/no-unsupported-features/es-syntax": "error", |
| 43 | + "n/no-deprecated-api": "error", |
| 44 | + "n/no-missing-import": "error", |
| 45 | + "n/no-unpublished-bin": "error", |
| 46 | + "n/no-unpublished-require": "error", |
| 47 | + "n/process-exit-as-throw": "error", |
| 48 | + }, |
| 49 | + }, |
| 50 | + { |
| 51 | + files: ["src/**/*.js"], |
| 52 | + languageOptions: { |
| 53 | + sourceType: "module", |
| 54 | + ecmaVersion: 2021, |
| 55 | + }, |
| 56 | + }, |
| 57 | + { |
| 58 | + files: ["eslint.config.js", "**/*.config.js", "**/*.config.cjs"], |
| 59 | + rules: { |
| 60 | + "n/no-unpublished-require": "off", |
| 61 | + "n/no-unpublished-import": "off", |
| 62 | + }, |
| 63 | + }, |
| 64 | +]; |
0 commit comments