|
1 | | -import eslintPluginJs from "@eslint/js"; |
2 | | -import eslintPluginMarkdown from "@eslint/markdown"; |
3 | | -import eslintPluginStylistic from "@stylistic/eslint-plugin"; |
| 1 | +import css from "@eslint/css"; |
| 2 | +import {defineConfig} from "eslint/config"; |
4 | 3 | import globals from "globals"; |
5 | | -import {flatConfigs as importConfigs} from "eslint-plugin-import-x"; |
| 4 | +import {flatConfigs as importX} from "eslint-plugin-import-x"; |
| 5 | +import js from "@eslint/js"; |
| 6 | +import json from "@eslint/json"; |
| 7 | +import markdown from "@eslint/markdown"; |
| 8 | +import stylistic from "@stylistic/eslint-plugin"; |
6 | 9 |
|
7 | | -const config = [ |
8 | | - eslintPluginJs.configs.all, |
9 | | - importConfigs.recommended, |
10 | | - ...eslintPluginMarkdown.configs.recommended, |
11 | | - { |
12 | | - "files": ["**/*.md"], |
13 | | - "language": "markdown/gfm", |
14 | | - "plugins": { |
15 | | - eslintPluginMarkdown |
16 | | - }, |
17 | | - "rules": { |
18 | | - "logical-assignment-operators": "off", |
19 | | - "max-lines-per-function": "off", |
20 | | - "no-irregular-whitespace": "off" |
21 | | - } |
22 | | - }, |
| 10 | +export default defineConfig([ |
| 11 | + {"files": ["**/*.css"], "languageOptions": {"tolerant": true}, "plugins": {css}, "language": "css/css", "extends": ["css/recommended"], "rules": {"css/use-baseline": ["error", {"available": "newly"}]}}, |
23 | 12 | { |
24 | 13 | "files": ["**/*.js"], |
25 | 14 | "languageOptions": { |
| 15 | + "ecmaVersion": "latest", |
26 | 16 | "globals": { |
27 | 17 | ...globals.browser, |
28 | 18 | ...globals.node, |
29 | 19 | "Log": "readonly", |
30 | 20 | "Module": "readonly", |
31 | 21 | "WeatherObject": "readonly", |
32 | 22 | "config": "readonly" |
33 | | - }, |
34 | | - "sourceType": "commonjs" |
35 | | - }, |
36 | | - "plugins": { |
37 | | - ...eslintPluginStylistic.configs.all.plugins |
| 23 | + } |
38 | 24 | }, |
| 25 | + "plugins": {js, stylistic}, |
| 26 | + "extends": [importX.recommended, "js/all", "stylistic/all"], |
39 | 27 | "rules": { |
40 | | - ...eslintPluginStylistic.configs.all.rules, |
41 | 28 | "@stylistic/array-element-newline": ["error", "consistent"], |
42 | 29 | "@stylistic/dot-location": ["error", "property"], |
43 | 30 | "@stylistic/function-call-argument-newline": ["error", "consistent"], |
44 | 31 | "@stylistic/indent": ["error", 2], |
45 | 32 | "@stylistic/lines-around-comment": "off", |
| 33 | + "@stylistic/no-multi-spaces": ["error", {"ignoreEOLComments": true}], |
46 | 34 | "@stylistic/padded-blocks": ["error", "never"], |
47 | 35 | "@stylistic/quote-props": ["error", "as-needed"], |
48 | 36 | "capitalized-comments": "off", |
@@ -72,16 +60,17 @@ const config = [ |
72 | 60 | }, |
73 | 61 | "sourceType": "module" |
74 | 62 | }, |
75 | | - "plugins": { |
76 | | - ...eslintPluginStylistic.configs.all.plugins |
77 | | - }, |
| 63 | + "plugins": {js, stylistic}, |
| 64 | + "extends": [importX.recommended, "js/all", "stylistic/all"], |
78 | 65 | "rules": { |
79 | | - ...eslintPluginStylistic.configs.all.rules, |
80 | 66 | "@stylistic/array-element-newline": ["error", "consistent"], |
81 | 67 | "@stylistic/indent": ["error", 2], |
82 | | - "no-magic-numbers": ["error", {"ignore": [2, 4, 200, 500, 1000]}] |
| 68 | + "@stylistic/object-property-newline": ["error", {"allowAllPropertiesOnSameLine": true}], |
| 69 | + "import-x/no-unresolved": ["error", {"ignore": ["eslint/config"]}], |
| 70 | + "no-magic-numbers": ["error", {"ignore": [2, 4, 200, 500, 1000]}], |
| 71 | + "sort-keys": "off" |
83 | 72 | } |
84 | | - } |
85 | | -]; |
86 | | - |
87 | | -export default config; |
| 73 | + }, |
| 74 | + {"files": ["**/*.json"], "ignores": ["package-lock.json"], "plugins": {json}, "extends": ["json/recommended"], "language": "json/json"}, |
| 75 | + {"files": ["**/*.md"], "plugins": {markdown}, "extends": ["markdown/recommended"], "language": "markdown/gfm"} |
| 76 | +]); |
0 commit comments