@cherepanov.pavel/shareable-config 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +2 -3
- package/.editorconfig-get.js +3 -3
- package/.get-all.js +16 -12
- package/.gitattributes-get.js +3 -3
- package/.gitignore-get.js +33 -30
- package/.vscode/.code-snippets-get.js +34 -31
- package/.vscode/extensions.json +17 -17
- package/.vscode/extensions.json-get.js +25 -25
- package/.vscode/settings.json +36 -27
- package/.vscode/settings.json-get.js +25 -25
- package/README.md +13 -3
- package/env.json5.set.js +1 -1
- package/jsconfig.json +4 -7
- package/package.json +11 -1
- package/tools/eslint-config/configs/global.js +21 -18
- package/tools/eslint-config/configs/javascript.js +14 -14
- package/tools/eslint-config/configs/json.js +93 -0
- package/tools/eslint-config/configs/typescript.js +17 -17
- package/tools/eslint-config/configs/vue.js +22 -22
- package/tools/eslint-config/index.js +1 -0
- package/tools/eslint-config/rules/constants.js +10 -9
- package/tools/eslint-config/rules/javascript/index.js +2 -2
- package/tools/eslint-config/rules/javascript/possible-problems.js +76 -58
- package/tools/eslint-config/rules/javascript/suggestions.js +405 -249
- package/tools/eslint-config/rules/stylistic/jsFormatting.js +321 -167
- package/tools/eslint-config/rules/stylistic/tsFormatting.js +4 -4
- package/tools/eslint-config/rules/typescript/common.js +135 -126
- package/tools/eslint-config/rules/typescript/compatibility.js +20 -20
- package/tools/eslint-config/rules/typescript/extension.js +44 -44
- package/tools/eslint-config/rules/typescript/index.js +3 -3
- package/tools/eslint-config/rules/vue/base.js +2 -2
- package/tools/eslint-config/rules/vue/extension.js +47 -44
- package/tools/eslint-config/rules/vue/formatting.js +66 -36
- package/tools/eslint-config/rules/vue/index.js +5 -5
- package/tools/eslint-config/rules/vue/possibleProblems.js +182 -109
- package/tools/eslint-config/rules/vue/suggestions.js +82 -79
- package/tools/stylelint-config/config.js +18 -20
- package/tools/stylelint-config/rules/base.js +30 -24
- package/tools/stylelint-config/rules/conflicts.js +5 -5
- package/tools/stylelint-config/rules/order.js +38 -38
- package/tools/stylelint-config/rules/property-groups.js +392 -389
- package/tools/stylelint-config/rules/scss.js +9 -6
- package/tools/stylelint-config/rules/stylistic.js +110 -109
- package/utils/communication.js +26 -26
- package/utils/copy-with-override.js +35 -33
- package/utils/env.js +4 -4
- package/utils/file-header.js +9 -9
- package/utils/file.js +46 -46
- package/utils/merge.js +161 -155
package/.editorconfig
CHANGED
package/.editorconfig-get.js
CHANGED
package/.get-all.js
CHANGED
|
@@ -4,12 +4,12 @@ import { spawnSync } from 'child_process';
|
|
|
4
4
|
import { readFile } from 'fs/promises';
|
|
5
5
|
|
|
6
6
|
const commands = [
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
'get-editorconfig',
|
|
8
|
+
'get-gitattributes',
|
|
9
|
+
'get-gitignore',
|
|
10
|
+
'get-extensions',
|
|
11
|
+
'get-settings',
|
|
12
|
+
'get-code-snippets',
|
|
13
13
|
];
|
|
14
14
|
|
|
15
15
|
let hasError = false;
|
|
@@ -17,13 +17,17 @@ let hasError = false;
|
|
|
17
17
|
const pkg = JSON.parse(await readFile(new URL('./package.json', import.meta.url), 'utf8'));
|
|
18
18
|
|
|
19
19
|
commands.forEach((cmd) => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
const result = spawnSync('npx', [
|
|
21
|
+
'-p',
|
|
22
|
+
pkg.name,
|
|
23
|
+
cmd,
|
|
24
|
+
], { stdio: 'inherit' });
|
|
25
|
+
if (result.status !== 0) {
|
|
26
|
+
console.error(`\nОшибка при выполнении команды: ${cmd}`);
|
|
27
|
+
hasError = true;
|
|
28
|
+
}
|
|
25
29
|
});
|
|
26
30
|
|
|
27
31
|
if (hasError) {
|
|
28
|
-
|
|
32
|
+
process.exit(1);
|
|
29
33
|
}
|
package/.gitattributes-get.js
CHANGED
package/.gitignore-get.js
CHANGED
|
@@ -10,38 +10,41 @@ const fileName = '.gitignore';
|
|
|
10
10
|
const destFile = path.join(process.cwd(), fileName);
|
|
11
11
|
|
|
12
12
|
async function getGitignoreFileData(framework) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
13
|
+
const dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
const src = path.join(dirname, '.npmignore');
|
|
15
|
+
const srcFileData = await readFile(src, 'utf8');
|
|
16
|
+
|
|
17
|
+
const [commonData] = srcFileData.split(/^#\s*\w+/mu);
|
|
18
|
+
|
|
19
|
+
if (!framework) {
|
|
20
|
+
return commonData.trim();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const sections = srcFileData.split(/^#\s*/mu).slice(1);
|
|
24
|
+
const matchedSection = sections.find((section) => {
|
|
25
|
+
const [header] = section.split('\n');
|
|
26
|
+
return header.trim().toLowerCase() === framework;
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
if (matchedSection) {
|
|
30
|
+
const [
|
|
31
|
+
header,
|
|
32
|
+
...body
|
|
33
|
+
] = matchedSection.split('\n');
|
|
34
|
+
return `${commonData.trim()}\n\n# ${header}\n${body.join('\n').trim()}`.trim();
|
|
35
|
+
}
|
|
36
|
+
// Если не найдено — только общий контент
|
|
37
|
+
return commonData.trim();
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
try {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
const { repositoryFramework } = await getEnvs();
|
|
42
|
+
const srcFileData = await getGitignoreFileData(repositoryFramework);
|
|
43
|
+
await copyWithOverride({
|
|
44
|
+
destFile,
|
|
45
|
+
srcFileData,
|
|
46
|
+
fileLabel: fileName,
|
|
47
|
+
});
|
|
45
48
|
} catch (err) {
|
|
46
|
-
|
|
49
|
+
console.error('Ошибка:', err.message);
|
|
47
50
|
}
|
|
@@ -8,42 +8,45 @@ import { getHeader } from '../utils/file-header.js';
|
|
|
8
8
|
import { getSrcJSONFileData } from '../utils/file.js';
|
|
9
9
|
import { getEnvs } from '../utils/env.js';
|
|
10
10
|
|
|
11
|
-
const fileNames = [
|
|
11
|
+
const fileNames = [
|
|
12
|
+
'vue.code-snippets',
|
|
13
|
+
'all-files.code-snippets',
|
|
14
|
+
];
|
|
12
15
|
|
|
13
16
|
try {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
const {
|
|
18
|
+
isRepositoryUseTypescript: isTs,
|
|
19
|
+
} = await getEnvs();
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
fileNames.forEach(async (fileName) => {
|
|
22
|
+
const srcFileData = await getSrcJSONFileData({
|
|
23
|
+
fileName,
|
|
24
|
+
isTs,
|
|
25
|
+
removeDuplicateKeys: fileName === 'vue.code-snippets',
|
|
26
|
+
});
|
|
24
27
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
const destFile = path.join(process.cwd(), `.vscode/${fileName}`);
|
|
29
|
+
let destFileData;
|
|
30
|
+
let isDestFileHaveOverride;
|
|
31
|
+
try {
|
|
32
|
+
destFileData = await readFile(destFile, 'utf8');
|
|
33
|
+
isDestFileHaveOverride = destFileData.includes('// override');
|
|
34
|
+
} catch (err) {}
|
|
32
35
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
let result;
|
|
37
|
+
if (isDestFileHaveOverride) {
|
|
38
|
+
result = await mergeWithOverride(srcFileData, destFileData);
|
|
39
|
+
} else {
|
|
40
|
+
result = srcFileData;
|
|
41
|
+
}
|
|
39
42
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
await outputFile(destFile, `${getHeader()}${result}`);
|
|
44
|
+
if (isDestFileHaveOverride) {
|
|
45
|
+
console.info(`${fileName} обновлён с учётом override`);
|
|
46
|
+
} else {
|
|
47
|
+
console.info(`${fileName} пересоздан`);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
47
50
|
} catch (err) {
|
|
48
|
-
|
|
51
|
+
console.error('Ошибка:', err.message);
|
|
49
52
|
}
|
package/.vscode/extensions.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
"recommendations": [
|
|
3
|
+
// "eamodio.gitlens",
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
// typescript
|
|
6
|
+
"johnsoncodehk.vscode-tsconfig-helper",
|
|
7
|
+
// typescript
|
|
8
|
+
"yoavbls.pretty-ts-errors",
|
|
9
|
+
"vue.volar",
|
|
10
|
+
"mrmlnc.vscode-scss",
|
|
11
|
+
"ms-azuretools.vscode-containers",
|
|
12
|
+
// "redhat.vscode-yaml",
|
|
13
|
+
"savh.json5-kit",
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
"editorconfig.editorconfig",
|
|
16
|
+
"dbaeumer.vscode-eslint",
|
|
17
|
+
"stylelint.vscode-stylelint",
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
"streetsidesoftware.code-spell-checker",
|
|
20
|
+
"streetsidesoftware.code-spell-checker-russian",
|
|
21
21
|
|
|
22
22
|
// need to check that it's working well
|
|
23
23
|
// iulian-radu-at.find-unused-exports
|
|
24
|
-
|
|
24
|
+
],
|
|
25
25
|
}
|
|
@@ -12,32 +12,32 @@ const fileName = 'extensions.json';
|
|
|
12
12
|
const destFile = path.join(process.cwd(), `.vscode/${fileName}`);
|
|
13
13
|
|
|
14
14
|
try {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
const {
|
|
16
|
+
isRepositoryUseTypescript: isTs,
|
|
17
|
+
} = await getEnvs();
|
|
18
|
+
const baseContent = await getSrcJSONFileData({
|
|
19
|
+
fileName,
|
|
20
|
+
isTs,
|
|
21
|
+
});
|
|
22
|
+
let overrideContent;
|
|
23
|
+
try {
|
|
24
|
+
const fileData = await readFile(destFile, 'utf8');
|
|
25
|
+
overrideContent = fileData.includes('// override') ? fileData : undefined;
|
|
26
|
+
} catch (err) {}
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
let result;
|
|
29
|
+
if (overrideContent) {
|
|
30
|
+
result = await mergeWithOverride(baseContent, overrideContent);
|
|
31
|
+
} else {
|
|
32
|
+
result = baseContent;
|
|
33
|
+
}
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
await outputFile(destFile, `${getHeader()}${result}`);
|
|
36
|
+
if (overrideContent) {
|
|
37
|
+
console.info(`${fileName} обновлён с учётом override`);
|
|
38
|
+
} else {
|
|
39
|
+
console.info(`${fileName} пересоздан`);
|
|
40
|
+
}
|
|
41
41
|
} catch (err) {
|
|
42
|
-
|
|
42
|
+
console.error('Ошибка:', err.message);
|
|
43
43
|
}
|
package/.vscode/settings.json
CHANGED
|
@@ -1,42 +1,51 @@
|
|
|
1
1
|
{
|
|
2
|
+
"editor.tabSize": 2,
|
|
2
3
|
"editor.linkedEditing": true,
|
|
3
|
-
|
|
4
|
+
"editor.suggestSelection": "recentlyUsed",
|
|
4
5
|
"git.blame.editorDecoration.enabled": true,
|
|
5
6
|
|
|
6
7
|
"explorer.fileNesting.enabled": true,
|
|
7
8
|
"explorer.fileNesting.patterns": {
|
|
8
9
|
"frontend-configs.env.json5": "eslint.config.*s, stylelint.config.*s, .editorconfig",
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
".env.*.local": ".env.*",
|
|
11
|
+
".gitignore": ".gitattributes, lefthook.yml",
|
|
12
|
+
// ".gitlab-ci.yml": "Dockerfile, .releaserc.template.yaml",
|
|
13
|
+
"package.json": ".npmrc, package-lock.json",
|
|
14
|
+
"README.md": "*.md",
|
|
15
|
+
// typescript
|
|
16
|
+
"tsconfig.json": "tsconfig.*.json, *.d.ts",
|
|
16
17
|
},
|
|
17
18
|
|
|
18
19
|
"javascript.preferences.importModuleSpecifier": "non-relative",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
// typescript
|
|
21
|
+
"typescript.preferences.importModuleSpecifier": "non-relative",
|
|
22
|
+
// typescript
|
|
23
|
+
"typescript.tsdk": "./node_modules/typescript/lib",
|
|
24
|
+
// typescript
|
|
25
|
+
"typescript.enablePromptUseWorkspaceTsdk": true,
|
|
25
26
|
|
|
26
27
|
"json.validate.enable": false,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
"editor.formatOnSave": false,
|
|
29
|
+
"editor.codeActionsOnSave": {
|
|
30
|
+
"source.fixAll.eslint": "explicit",
|
|
31
|
+
"source.fixAll.stylelint": "explicit",
|
|
32
|
+
},
|
|
33
|
+
"eslint.validate": [
|
|
34
|
+
"javascript",
|
|
35
|
+
"typescript",
|
|
36
|
+
"html",
|
|
37
|
+
"vue",
|
|
38
|
+
"json",
|
|
39
|
+
"jsonc",
|
|
40
|
+
"json5",
|
|
41
|
+
],
|
|
32
42
|
// "stylelint.validate": [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
43
|
+
// "css",
|
|
44
|
+
// "scss",
|
|
45
|
+
// "vue"
|
|
46
|
+
// ],
|
|
38
47
|
"cSpell.words": [
|
|
39
|
-
|
|
40
|
-
|
|
48
|
+
"Cherepanov",
|
|
49
|
+
"Pavel",
|
|
41
50
|
],
|
|
42
|
-
}
|
|
51
|
+
}
|
|
@@ -12,32 +12,32 @@ const fileName = 'settings.json';
|
|
|
12
12
|
const destFile = path.join(process.cwd(), `.vscode/${fileName}`);
|
|
13
13
|
|
|
14
14
|
try {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
const {
|
|
16
|
+
isRepositoryUseTypescript: isTs,
|
|
17
|
+
} = await getEnvs();
|
|
18
|
+
const baseContent = await getSrcJSONFileData({
|
|
19
|
+
fileName,
|
|
20
|
+
isTs,
|
|
21
|
+
});
|
|
22
|
+
let overrideContent;
|
|
23
|
+
try {
|
|
24
|
+
const fileData = await readFile(destFile, 'utf8');
|
|
25
|
+
overrideContent = fileData.includes('// override') ? fileData : undefined;
|
|
26
|
+
} catch (err) {}
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
let result;
|
|
29
|
+
if (overrideContent) {
|
|
30
|
+
result = await mergeWithOverride(baseContent, overrideContent);
|
|
31
|
+
} else {
|
|
32
|
+
result = baseContent;
|
|
33
|
+
}
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
await outputFile(destFile, `${getHeader()}${result}`);
|
|
36
|
+
if (overrideContent) {
|
|
37
|
+
console.info(`${fileName} обновлён с учётом override`);
|
|
38
|
+
} else {
|
|
39
|
+
console.info(`${fileName} пересоздан`);
|
|
40
|
+
}
|
|
41
41
|
} catch (err) {
|
|
42
|
-
|
|
42
|
+
console.error('Ошибка:', err.message);
|
|
43
43
|
}
|
package/README.md
CHANGED
|
@@ -51,7 +51,17 @@ import {
|
|
|
51
51
|
jsConfig,
|
|
52
52
|
tsConfig,
|
|
53
53
|
vueConfig,
|
|
54
|
-
} from '@
|
|
54
|
+
} from '@cherepanov.pavel/shareable-config/tools/eslint-config/index.js';
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Before:
|
|
58
|
+
```js
|
|
59
|
+
import baseConfig from './tools/stylelint-config/config.js';
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
After:
|
|
63
|
+
```js
|
|
64
|
+
import baseConfig from '@cherepanov.pavel/shareable-config/tools/stylelint-config/config.js';
|
|
55
65
|
```
|
|
56
66
|
|
|
57
67
|
5. **Override rules via the `override` function in your own configs where needed.**
|
|
@@ -70,12 +80,12 @@ import {
|
|
|
70
80
|
|
|
71
81
|
After installing the package, run:
|
|
72
82
|
```sh
|
|
73
|
-
npx -p "@
|
|
83
|
+
npx -p "@cherepanov.pavel/shareable-config" set-env
|
|
74
84
|
```
|
|
75
85
|
|
|
76
86
|
Then run:
|
|
77
87
|
```sh
|
|
78
|
-
npx -p "@
|
|
88
|
+
npx -p "@cherepanov.pavel/shareable-config" get-all
|
|
79
89
|
```
|
|
80
90
|
|
|
81
91
|
or run any other command if you want to update partially.
|
package/env.json5.set.js
CHANGED
package/jsconfig.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cherepanov.pavel/shareable-config",
|
|
3
3
|
"description": "setup for new repositories",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"devEngines": {
|
|
7
7
|
"packageManager": {
|
|
@@ -41,6 +41,14 @@
|
|
|
41
41
|
"get-settings": "./.vscode/settings.json-get.js",
|
|
42
42
|
"get-code-snippets": "./.vscode/.code-snippets-get.js"
|
|
43
43
|
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"lint": "run-p -lc lint:js lint:css",
|
|
46
|
+
"lint:fix": "run-p -lc lint:js:fix lint:css:fix lint:types",
|
|
47
|
+
"lint:js": "eslint",
|
|
48
|
+
"lint:js:fix": "npm run lint:js -- --fix",
|
|
49
|
+
"lint:css": "stylelint \"./**/*.{css,vue}\" --ignore-path .gitignore --formatter verbose",
|
|
50
|
+
"lint:css:fix": "npm run lint:css:files -- --fix"
|
|
51
|
+
},
|
|
44
52
|
"dependencies": {
|
|
45
53
|
"@eslint/compat": "2.1.0",
|
|
46
54
|
"@stylistic/eslint-plugin": "5.10.0",
|
|
@@ -48,8 +56,10 @@
|
|
|
48
56
|
"@typescript-eslint/eslint-plugin": "^8.66.0",
|
|
49
57
|
"@typescript-eslint/parser": "^8.66.0",
|
|
50
58
|
"eslint": "^10.8.1",
|
|
59
|
+
"eslint-plugin-jsonc": "^3.4.1",
|
|
51
60
|
"eslint-plugin-vue": "^10.10.0",
|
|
52
61
|
"fs-extra": "^11.4.0",
|
|
62
|
+
"globals": "^17.9.0",
|
|
53
63
|
"jiti": "^2.7.0",
|
|
54
64
|
"json5": "^2.2.3",
|
|
55
65
|
"postcss-html": "^2.0.0",
|
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
import { defineConfig } from 'eslint/config';
|
|
2
|
-
import { includeIgnoreFile } from '@eslint/
|
|
2
|
+
import { includeIgnoreFile } from '@eslint/config-helpers';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import globals from 'globals';
|
|
5
5
|
|
|
6
6
|
const gitignorePath = path.join(process.cwd(), '.gitignore');
|
|
7
7
|
|
|
8
8
|
export default defineConfig([
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
includeIgnoreFile(gitignorePath),
|
|
10
|
+
{
|
|
11
|
+
name: 'Additional .gitignore patterns',
|
|
12
|
+
ignores: [
|
|
13
|
+
'public/js/*',
|
|
14
|
+
'**/*.code-snippets',
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
files: [
|
|
19
|
+
'**/*.*js',
|
|
20
|
+
'**/*.*vue',
|
|
21
|
+
],
|
|
22
|
+
languageOptions: {
|
|
23
|
+
globals: {
|
|
24
|
+
...globals.browser,
|
|
25
|
+
...globals.node,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
26
29
|
]);
|
|
@@ -4,18 +4,18 @@ import { jsRules } from '../rules/javascript/index.js';
|
|
|
4
4
|
import { jsFormatting } from '../rules/stylistic/index.js';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
files: ['**/*.*js'],
|
|
8
|
+
plugins: {
|
|
9
|
+
'@stylistic': stylisticPlugin,
|
|
10
|
+
},
|
|
11
|
+
languageOptions: {
|
|
12
|
+
sourceType: 'module',
|
|
13
|
+
parserOptions: {
|
|
14
|
+
sourceType: 'module',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
rules: {
|
|
18
|
+
...jsRules,
|
|
19
|
+
...jsFormatting,
|
|
20
|
+
},
|
|
21
21
|
};
|