Skip to content

Commit 68f22a0

Browse files
committed
chore: update ESLint configuration and adjust .gitignore and VSCode settings
1 parent fc9e603 commit 68f22a0

4 files changed

Lines changed: 77 additions & 72 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ temp/
9696
.temp/
9797

9898
# Editor directories and files
99-
.vscode/*
10099
!.vscode/extensions.json
101100
.idea
102101
*.suo

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@
183183
"*.env": "$(capture).env.*",
184184
"README.md": "README*,CHANGELOG*,LICENSE,CNAME",
185185
"package.json": "pnpm-lock.yaml,pnpm-workspace.yaml,.gitattributes,.gitignore,.gitpod.yml,.npmrc,.browserslistrc,.node-version,.git*,.tazerc.json,nodemon.json,.appveyor.yml,.npmignore,nyc.config.js",
186-
".eslintrc": ".eslintrc,.eslintignore,.prettierignore,.stylelintignore,.commitlintrc.*,.prettierrc.*,stylelint.config.*,.lintstagedrc.mjs,cspell.json"
186+
"eslint.config.mjs": ".eslintrc,.eslintignore,.prettierignore,.stylelintignore,.commitlintrc.*,.prettierrc.*,stylelint.config.*,.lintstagedrc.mjs,cspell.json"
187187
},
188188
"typescript.tsdk": "node_modules/typescript/lib"
189189
}

commands/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ runtime/
8686
nyc.config.js
8787
coverage/
8888
`);
89-
await _write(path.join(output, '.eslintrc'), await _read(path.join(__dirname, '../', '.eslintrc')));
89+
await _write(path.join(output, 'eslint.config.mjs'), await _read(path.join(__dirname, '../', 'eslint.config.mjs')));
9090

9191
printer.print('-'.repeat(25).input).println();
9292
printer.green('Complete initialisation').println();

eslint.config.mjs

Lines changed: 75 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -7,91 +7,97 @@ import { FlatCompat } from "@eslint/eslintrc";
77
const __filename = fileURLToPath(import.meta.url);
88
const __dirname = path.dirname(__filename);
99
const compat = new FlatCompat({
10-
baseDirectory: __dirname,
11-
recommendedConfig: js.configs.recommended,
12-
allConfig: js.configs.all
10+
baseDirectory: __dirname,
11+
recommendedConfig: js.configs.recommended,
12+
allConfig: js.configs.all
1313
});
1414

15-
export default [...compat.extends("eslint:recommended"), {
15+
export default [
16+
{
17+
ignores: ['eslint.config.mjs']
18+
},
19+
...compat.extends("eslint:recommended"),
20+
{
1621
languageOptions: {
17-
globals: {
18-
...globals.node,
19-
...globals.browser,
20-
describe: true,
21-
it: true,
22-
before: true,
23-
after: true,
24-
beforeEach: true,
25-
},
22+
globals: {
23+
...globals.node,
24+
...globals.browser,
25+
describe: true,
26+
it: true,
27+
before: true,
28+
after: true,
29+
beforeEach: true,
30+
},
2631

27-
ecmaVersion: 2018,
28-
sourceType: "commonjs",
32+
ecmaVersion: 2018,
33+
sourceType: "commonjs",
2934

30-
parserOptions: {
31-
ecmaFeatures: {},
32-
},
35+
parserOptions: {
36+
ecmaFeatures: {},
37+
},
3338
},
3439

3540
rules: {
36-
indent: [2, 2, {
37-
SwitchCase: 1,
38-
}],
41+
indent: [2, 2, {
42+
SwitchCase: 1,
43+
}],
3944

40-
quotes: [2, "single"],
41-
"linebreak-style": [2, "unix"],
42-
semi: [2, "always"],
43-
curly: 2,
44-
eqeqeq: 2,
45-
"no-eval": 2,
46-
"guard-for-in": 2,
47-
"no-caller": 2,
48-
"no-else-return": 2,
49-
"no-eq-null": 2,
50-
"no-extend-native": 2,
51-
"no-extra-bind": 2,
52-
"no-floating-decimal": 2,
53-
"no-implied-eval": 2,
54-
"no-labels": 2,
55-
"no-with": 2,
56-
"no-loop-func": 2,
57-
"no-native-reassign": 2,
45+
quotes: [2, "single"],
46+
"linebreak-style": [2, "unix"],
47+
semi: [2, "always"],
48+
curly: 2,
49+
eqeqeq: 2,
50+
"no-eval": 2,
51+
"guard-for-in": 2,
52+
"no-caller": 2,
53+
"no-else-return": 2,
54+
"no-eq-null": 2,
55+
"no-extend-native": 2,
56+
"no-extra-bind": 2,
57+
"no-floating-decimal": 2,
58+
"no-implied-eval": 2,
59+
"no-labels": 2,
60+
"no-with": 2,
61+
"no-loop-func": 2,
62+
"no-native-reassign": 2,
5863

59-
"no-redeclare": [2, {
60-
builtinGlobals: true,
61-
}],
64+
"no-redeclare": [2, {
65+
builtinGlobals: true,
66+
}],
6267

63-
"no-delete-var": 2,
64-
"no-shadow-restricted-names": 2,
65-
"no-undef-init": 2,
66-
"no-use-before-define": 2,
68+
"no-delete-var": 2,
69+
"no-shadow-restricted-names": 2,
70+
"no-undef-init": 2,
71+
"no-use-before-define": 2,
6772

68-
"no-unused-vars": [2, {
69-
args: "none",
70-
}],
73+
"no-unused-vars": [2, {
74+
args: "none",
75+
}],
7176

72-
"no-undefined": 2,
73-
"no-undef": 2,
74-
"global-require": 0,
75-
"no-console": 2,
77+
"no-undefined": 2,
78+
"no-undef": 2,
79+
"global-require": 0,
80+
"no-console": 2,
7681

77-
"key-spacing": [2, {
78-
beforeColon: false,
79-
afterColon: true,
80-
}],
82+
"key-spacing": [2, {
83+
beforeColon: false,
84+
afterColon: true,
85+
}],
8186

82-
"eol-last": [2, "always"],
83-
"no-inner-declarations": [1],
84-
"no-case-declarations": [1],
87+
"eol-last": [2, "always"],
88+
"no-inner-declarations": [1],
89+
"no-case-declarations": [1],
8590

86-
"no-multiple-empty-lines": [2, {
87-
max: 1,
88-
maxBOF: 1,
89-
}],
91+
"no-multiple-empty-lines": [2, {
92+
max: 1,
93+
maxBOF: 1,
94+
}],
9095

91-
"space-in-parens": [2, "never"],
96+
"space-in-parens": [2, "never"],
9297

93-
"no-multi-spaces": [2, {
94-
ignoreEOLComments: true,
95-
}],
98+
"no-multi-spaces": [2, {
99+
ignoreEOLComments: true,
100+
}],
96101
},
97-
}];
102+
}
103+
];

0 commit comments

Comments
 (0)