-
Notifications
You must be signed in to change notification settings - Fork 6
/
eslint.config.js
68 lines (67 loc) · 1.63 KB
/
eslint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// eslint.config.js
import eslintprettier from 'eslint-plugin-prettier';
import eslintplugin from 'eslint-plugin-import';
import babelParser from '@babel/eslint-parser';
export default [
{
files: ["**/*.js"],
ignores: ["eslint.config.js"],
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
parser: babelParser, // Use Babel parser for modern features
parserOptions: {
requireConfigFile: false, // Ensure Babel can be used without a config file
babelOptions: {
presets: ['@babel/preset-env'],
plugins: ['@babel/plugin-syntax-import-assertions'],
},
},
},
plugins: {
prettier: eslintprettier,
import: eslintplugin,
},
rules: {
"prettier/prettier": [
"error",
{
trailingComma: "all",
printWidth: 90,
singleQuote: true,
},
],
"no-unused-vars": "error",
"prefer-const": "error",
"no-underscore-dangle": "off",
"comma-dangle": ["error", "always-multiline"],
"no-console": "off",
"import/order": [
"error",
{
alphabetize: {
order: "asc",
caseInsensitive: true,
},
"newlines-between": "always-and-inside-groups",
groups: [
"builtin",
"external",
"internal",
["sibling", "parent"],
"index",
"object",
"type",
],
},
],
},
settings: {
"import/resolver": {
node: {
extensions: [".js", ".json"],
},
},
},
},
];