|
| 1 | +import * as myPlugin from "@ota-meshi/eslint-plugin"; |
| 2 | +import globals from "globals"; |
| 3 | + |
| 4 | +export default [ |
| 5 | + { |
| 6 | + ignores: [ |
| 7 | + ".nyc_output", |
| 8 | + "coverage", |
| 9 | + "lib", |
| 10 | + "node_modules", |
| 11 | + "tests/fixtures/**/*.json", |
| 12 | + "tests/fixtures/**/*.svelte", |
| 13 | + "tests/fixtures/**/*.js", |
| 14 | + "tests/fixtures/**/*.ts", |
| 15 | + "explorer/dist", |
| 16 | + "explorer/node_modules", |
| 17 | + "explorer-v2/build", |
| 18 | + "explorer-v2/build", |
| 19 | + "explorer-v2/build-system/shim/svelte-eslint-parser.*", |
| 20 | + "explorer-v2/build-system/shim/eslint-scope.*", |
| 21 | + "explorer-v2/build-system/shim/eslint.*", |
| 22 | + "explorer-v2/build-system/shim/svelte/*", |
| 23 | + "!.vscode", |
| 24 | + "!.github", |
| 25 | + "explorer-v2/.svelte-kit", |
| 26 | + ".changeset/pre.json", |
| 27 | + ], |
| 28 | + }, |
| 29 | + ...myPlugin.config({ |
| 30 | + node: true, |
| 31 | + ts: true, |
| 32 | + json: true, |
| 33 | + packageJson: true, |
| 34 | + yaml: true, |
| 35 | + prettier: true, |
| 36 | + }), |
| 37 | + { |
| 38 | + languageOptions: { |
| 39 | + sourceType: "module", |
| 40 | + }, |
| 41 | + |
| 42 | + rules: { |
| 43 | + "no-lonely-if": "off", |
| 44 | + "no-shadow": "off", |
| 45 | + "@typescript-eslint/no-shadow": "off", |
| 46 | + "no-warning-comments": "warn", |
| 47 | + "jsdoc/require-jsdoc": "off", |
| 48 | + complexity: "off", |
| 49 | + |
| 50 | + "prettier/prettier": [ |
| 51 | + "error", |
| 52 | + {}, |
| 53 | + { |
| 54 | + usePrettierrc: true, |
| 55 | + }, |
| 56 | + ], |
| 57 | + }, |
| 58 | + }, |
| 59 | + { |
| 60 | + files: ["**/*.ts"], |
| 61 | + |
| 62 | + languageOptions: { |
| 63 | + parserOptions: { |
| 64 | + project: "./tsconfig.json", |
| 65 | + }, |
| 66 | + }, |
| 67 | + |
| 68 | + rules: { |
| 69 | + "@typescript-eslint/naming-convention": [ |
| 70 | + "error", |
| 71 | + { |
| 72 | + selector: "default", |
| 73 | + format: ["camelCase"], |
| 74 | + leadingUnderscore: "allow", |
| 75 | + trailingUnderscore: "allow", |
| 76 | + }, |
| 77 | + { |
| 78 | + selector: "variable", |
| 79 | + format: ["camelCase", "UPPER_CASE"], |
| 80 | + leadingUnderscore: "allow", |
| 81 | + trailingUnderscore: "allow", |
| 82 | + }, |
| 83 | + { |
| 84 | + selector: "typeLike", |
| 85 | + format: ["PascalCase"], |
| 86 | + }, |
| 87 | + { |
| 88 | + selector: "property", |
| 89 | + format: null, |
| 90 | + }, |
| 91 | + { |
| 92 | + selector: "method", |
| 93 | + format: null, |
| 94 | + }, |
| 95 | + { |
| 96 | + selector: "import", |
| 97 | + format: ["camelCase", "PascalCase", "UPPER_CASE"], |
| 98 | + }, |
| 99 | + ], |
| 100 | + |
| 101 | + "@typescript-eslint/no-non-null-assertion": "off", |
| 102 | + "@typescript-eslint/no-use-before-define": "off", |
| 103 | + "@typescript-eslint/no-explicit-any": "off", |
| 104 | + "no-implicit-globals": "off", |
| 105 | + |
| 106 | + "no-void": [ |
| 107 | + "error", |
| 108 | + { |
| 109 | + allowAsStatement: true, |
| 110 | + }, |
| 111 | + ], |
| 112 | + }, |
| 113 | + }, |
| 114 | + { |
| 115 | + files: ["scripts/**/*.ts", "tests/**/*.ts"], |
| 116 | + |
| 117 | + rules: { |
| 118 | + "no-console": "off", |
| 119 | + "jsdoc/require-jsdoc": "off", |
| 120 | + }, |
| 121 | + }, |
| 122 | + |
| 123 | + ...myPlugin |
| 124 | + .config({ |
| 125 | + prettier: true, |
| 126 | + svelte: true, |
| 127 | + }) |
| 128 | + .map(async (config) => ({ |
| 129 | + ...(await config), |
| 130 | + files: ["explorer-v2/**/*.svelte"], |
| 131 | + })), |
| 132 | + { |
| 133 | + files: ["explorer-v2/**/*.{svelte,js}"], |
| 134 | + languageOptions: { |
| 135 | + globals: { |
| 136 | + ...globals.browser, |
| 137 | + }, |
| 138 | + }, |
| 139 | + rules: { |
| 140 | + "eslint-comments/no-unused-disable": "off", |
| 141 | + "n/no-missing-import": "off", |
| 142 | + "n/no-unpublished-require": "off", |
| 143 | + "n/no-unpublished-import": "off", |
| 144 | + "n/no-unsupported-features/es-syntax": "off", |
| 145 | + "n/no-unsupported-features/node-builtins": "off", |
| 146 | + "require-jsdoc": "off", |
| 147 | + "n/file-extension-in-import": "off", |
| 148 | + |
| 149 | + "prettier/prettier": [ |
| 150 | + "error", |
| 151 | + {}, |
| 152 | + { |
| 153 | + usePrettierrc: true, |
| 154 | + }, |
| 155 | + ], |
| 156 | + |
| 157 | + "no-shadow": "off", |
| 158 | + camelcase: "off", |
| 159 | + }, |
| 160 | + }, |
| 161 | + { |
| 162 | + files: ["**/*.d.ts"], |
| 163 | + rules: { |
| 164 | + "spaced-comment": "off", |
| 165 | + }, |
| 166 | + }, |
| 167 | +]; |
0 commit comments