Lines 1-8
Link Here
|
1 |
import prettier from "eslint-plugin-prettier"; |
1 |
import prettier from "eslint-plugin-prettier"; |
|
|
2 |
import eslintConfigPrettier from "eslint-config-prettier"; |
2 |
import globals from "globals"; |
3 |
import globals from "globals"; |
3 |
import path from "node:path"; |
4 |
import path from "node:path"; |
4 |
import { fileURLToPath } from "node:url"; |
5 |
import { fileURLToPath } from "node:url"; |
5 |
import js from "@eslint/js"; |
6 |
import js from "@eslint/js"; |
|
|
7 |
import pluginVue from "eslint-plugin-vue"; |
8 |
import ts from "typescript-eslint"; |
6 |
import { FlatCompat } from "@eslint/eslintrc"; |
9 |
import { FlatCompat } from "@eslint/eslintrc"; |
7 |
|
10 |
|
8 |
const __filename = fileURLToPath(import.meta.url); |
11 |
const __filename = fileURLToPath(import.meta.url); |
Lines 10-34
const __dirname = path.dirname(__filename);
Link Here
|
10 |
const compat = new FlatCompat({ |
13 |
const compat = new FlatCompat({ |
11 |
baseDirectory: __dirname, |
14 |
baseDirectory: __dirname, |
12 |
recommendedConfig: js.configs.recommended, |
15 |
recommendedConfig: js.configs.recommended, |
13 |
allConfig: js.configs.all |
16 |
allConfig: js.configs.all, |
14 |
}); |
17 |
}); |
15 |
|
18 |
|
16 |
export default [...compat.extends("eslint:recommended", "eslint-config-prettier"), { |
19 |
export default [ |
17 |
plugins: { |
20 |
...compat.extends("eslint:recommended", "eslint-config-prettier"), |
18 |
prettier, |
21 |
...ts.configs.recommended, |
19 |
}, |
22 |
...pluginVue.configs["flat/recommended"], |
20 |
|
23 |
eslintConfigPrettier, |
21 |
languageOptions: { |
24 |
{ |
22 |
globals: { |
25 |
plugins: { |
23 |
...globals.browser, |
26 |
prettier, |
24 |
...globals.jquery, |
27 |
}, |
|
|
28 |
languageOptions: { |
29 |
globals: { |
30 |
...globals.browser, |
31 |
...globals.jquery, |
32 |
}, |
33 |
}, |
34 |
rules: { |
35 |
"prettier/prettier": ["error"], |
25 |
}, |
36 |
}, |
26 |
}, |
37 |
}, |
27 |
|
38 |
]; |
28 |
rules: { |
|
|
29 |
indent: ["error", 4], |
30 |
"linebreak-style": ["error", "unix"], |
31 |
semi: ["error", "always"], |
32 |
"prettier/prettier": ["error"], |
33 |
}, |
34 |
}]; |