|
| 1 | +import js from "@eslint/js" |
| 2 | +import globals from "globals" |
| 3 | +import tseslint from "typescript-eslint" |
| 4 | +import { defineConfig } from "eslint/config" |
| 5 | +import eslintPluginAstro from "eslint-plugin-astro" |
| 6 | + |
| 7 | +// can't use @eslint/css with the astro eslint plugin - see this gh issue for |
| 8 | +// details: https://github.com/ota-meshi/eslint-plugin-astro/issues/485 |
| 9 | +export default defineConfig([ |
| 10 | + { |
| 11 | + files: ["**/*.{js,mjs,cjs,ts}"], |
| 12 | + plugins: { js }, |
| 13 | + extends: ["js/recommended"], |
| 14 | + }, |
| 15 | + { |
| 16 | + files: ["**/*.{js,mjs,cjs,ts}"], |
| 17 | + languageOptions: { globals: { ...globals.browser, ...globals.node } }, |
| 18 | + }, |
| 19 | + ...tseslint.configs.recommended, |
| 20 | + ...eslintPluginAstro.configs.recommended, |
| 21 | + ...eslintPluginAstro.configs["jsx-a11y-strict"], |
| 22 | + { |
| 23 | + rules: { |
| 24 | + "default-case-last": "error", |
| 25 | + eqeqeq: "error", |
| 26 | + "no-await-in-loop": "warn", |
| 27 | + "no-duplicate-imports": "error", |
| 28 | + "no-implicit-coercion": "error", |
| 29 | + "no-label-var": "error", |
| 30 | + "no-self-compare": "error", |
| 31 | + "no-template-curly-in-string": "error", |
| 32 | + "no-unmodified-loop-condition": "error", |
| 33 | + "no-unreachable-loop": "error", |
| 34 | + "no-useless-assignment": "error", |
| 35 | + "prefer-promise-reject-errors": "error", |
| 36 | + yoda: "warn", |
| 37 | + }, |
| 38 | + }, |
| 39 | +]) |
0 commit comments