@w5s/cspell-config 3.0.4 → 3.1.0
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/dist/index.d.ts +1809 -5
- package/dist/index.js +97 -96
- package/dist/index.js.map +1 -1
- package/package.json +4 -31
- package/src/config.ts +101 -0
- package/src/index.ts +2 -103
- package/src/meta.ts +8 -0
- package/dict/filetypes.txt +0 -9
- package/dict/fullstack.txt +0 -23
- package/dict/names.txt +0 -19
- package/dict/npm.txt +0 -8
- package/dict/typescript.txt +0 -7
package/dist/index.js
CHANGED
|
@@ -1,100 +1,101 @@
|
|
|
1
|
-
import cSpellSettings from
|
|
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
|
-
|
|
1
|
+
import cSpellSettings from "@cspell/cspell-bundled-dicts/cspell-default.config.js";
|
|
2
|
+
//#region src/meta.ts
|
|
3
|
+
const meta = Object.freeze({
|
|
4
|
+
name: "@w5s/cspell-config",
|
|
5
|
+
version: "3.1.0",
|
|
6
|
+
buildNumber: 1
|
|
7
|
+
});
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/config.ts
|
|
10
|
+
const toArray = (value) => Array.isArray(value) ? value : value == null ? [] : [value];
|
|
11
|
+
const defaultSettings = cSpellSettings;
|
|
12
|
+
const excludeImport = /* @__PURE__ */ new Set([]);
|
|
13
|
+
const dictionaryDefinitions = [
|
|
14
|
+
{
|
|
15
|
+
addWords: false,
|
|
16
|
+
name: "w5s-filetypes",
|
|
17
|
+
path: "../dict/filetypes.txt",
|
|
18
|
+
description: "Additional file types"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
addWords: false,
|
|
22
|
+
name: "w5s-fullstack",
|
|
23
|
+
path: "../dict/fullstack.txt",
|
|
24
|
+
description: "Fullstack terms"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
addWords: false,
|
|
28
|
+
name: "w5s-typescript",
|
|
29
|
+
path: "../dict/typescript.txt",
|
|
30
|
+
description: "Typescript keywords"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
addWords: false,
|
|
34
|
+
name: "w5s-names",
|
|
35
|
+
path: "../dict/names.txt",
|
|
36
|
+
description: "Known names"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
addWords: false,
|
|
40
|
+
name: "w5s-npm",
|
|
41
|
+
path: "../dict/npm.txt",
|
|
42
|
+
description: "NPM packages"
|
|
43
|
+
}
|
|
40
44
|
];
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
]
|
|
45
|
+
const config = {
|
|
46
|
+
...defaultSettings,
|
|
47
|
+
name: "W5S default settings .js",
|
|
48
|
+
id: "w5s-default-js",
|
|
49
|
+
language: "en",
|
|
50
|
+
description: "Default cspell configuration.",
|
|
51
|
+
words: [],
|
|
52
|
+
flagWords: [],
|
|
53
|
+
useGitignore: true,
|
|
54
|
+
dictionaryDefinitions: [...toArray(defaultSettings.dictionaryDefinitions), ...dictionaryDefinitions],
|
|
55
|
+
dictionaries: [...toArray(defaultSettings.dictionaries), ...dictionaryDefinitions.map((dictionaryDefinition) => dictionaryDefinition.name).filter((name) => !["w5s-typescript"].includes(name))],
|
|
56
|
+
ignoreWords: [],
|
|
57
|
+
import: toArray(defaultSettings.import).filter((dict) => !excludeImport.has(dict)),
|
|
58
|
+
ignorePaths: [
|
|
59
|
+
...toArray(defaultSettings.ignorePaths),
|
|
60
|
+
"**/CHANGELOG.md",
|
|
61
|
+
"**/__snapshots__/**",
|
|
62
|
+
"**/.vscode/**",
|
|
63
|
+
"**/*.snap",
|
|
64
|
+
"**/dist/**",
|
|
65
|
+
"**/node_modules/**",
|
|
66
|
+
"**/package.json",
|
|
67
|
+
"**/package-lock.json",
|
|
68
|
+
"**/renovate.json",
|
|
69
|
+
"**/vscode-extension/**",
|
|
70
|
+
"**/yarn.lock",
|
|
71
|
+
"**/pnpm-lock.yaml",
|
|
72
|
+
"**/*.svg",
|
|
73
|
+
"**/*.webp",
|
|
74
|
+
"**/*.webm"
|
|
75
|
+
],
|
|
76
|
+
languageSettings: [
|
|
77
|
+
...toArray(defaultSettings.languageSettings),
|
|
78
|
+
{
|
|
79
|
+
languageId: "typescript,javascript,typescriptreact,javascriptreact",
|
|
80
|
+
locale: "*",
|
|
81
|
+
includeRegExpList: [],
|
|
82
|
+
ignoreRegExpList: [
|
|
83
|
+
"js-hex-escape",
|
|
84
|
+
"js-unicode-escape",
|
|
85
|
+
"js-regexp-flags"
|
|
86
|
+
],
|
|
87
|
+
patterns: [],
|
|
88
|
+
dictionaries: ["w5s-typescript"],
|
|
89
|
+
dictionaryDefinitions: []
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
languageId: "typescript,javascript,typescriptreact,javascriptreact",
|
|
93
|
+
locale: "*",
|
|
94
|
+
ignoreRegExpList: ["\\/\\* eslint-disable.+", "\\/\\/ eslint-disable.+"]
|
|
95
|
+
}
|
|
96
|
+
]
|
|
95
97
|
};
|
|
96
|
-
|
|
98
|
+
//#endregion
|
|
99
|
+
export { config as default, meta };
|
|
97
100
|
|
|
98
|
-
export { index_default as default };
|
|
99
|
-
//# sourceMappingURL=index.js.map
|
|
100
101
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/meta.ts","../src/config.ts"],"sourcesContent":["export const meta = Object.freeze({\n // @ts-ignore - these variables are injected at build time\n name: (typeof __PACKAGE_NAME__ === 'undefined' ? '' : __PACKAGE_NAME__) as string,\n // @ts-ignore - these variables are injected at build time\n version: (typeof __PACKAGE_VERSION__ === 'undefined' ? '' : __PACKAGE_VERSION__) as string,\n // @ts-ignore - these variables are injected at build time\n buildNumber: 1 as number, // (typeof __PACKAGE_BUILD_NUMBER__ === 'undefined' ? 0 : __PACKAGE_BUILD_NUMBER__) as number,\n});\n","import type { AdvancedCSpellSettings } from '@cspell/cspell-types';\n// @ts-ignore CSpell config is not typed\nimport cSpellSettings from '@cspell/cspell-bundled-dicts/cspell-default.config.js';\n\nconst toArray = <T>(value: T | T[] | undefined) => (Array.isArray(value) ? value : value == null ? [] : [value]);\nconst defaultSettings = cSpellSettings as AdvancedCSpellSettings;\n// eslint-disable-next-line unicorn/no-useless-collection-argument\nconst excludeImport = new Set<string>([\n // Put here the imports you want to exclude\n]);\nconst dictionaryDefinitions: AdvancedCSpellSettings['dictionaryDefinitions'] = [\n {\n addWords: false,\n name: 'w5s-filetypes',\n path: '../dict/filetypes.txt',\n description: 'Additional file types',\n },\n {\n addWords: false,\n name: 'w5s-fullstack',\n path: '../dict/fullstack.txt',\n description: 'Fullstack terms',\n },\n {\n addWords: false,\n name: 'w5s-typescript',\n path: '../dict/typescript.txt',\n description: 'Typescript keywords',\n },\n {\n addWords: false,\n name: 'w5s-names',\n path: '../dict/names.txt',\n description: 'Known names',\n },\n {\n addWords: false,\n name: 'w5s-npm',\n path: '../dict/npm.txt',\n description: 'NPM packages',\n },\n];\n\nexport const config: AdvancedCSpellSettings = {\n ...defaultSettings,\n name: 'W5S default settings .js',\n id: 'w5s-default-js',\n language: 'en',\n description: 'Default cspell configuration.',\n words: [],\n flagWords: [],\n useGitignore: true,\n dictionaryDefinitions: [...toArray(defaultSettings.dictionaryDefinitions), ...dictionaryDefinitions],\n dictionaries: [\n ...toArray(defaultSettings.dictionaries),\n ...dictionaryDefinitions\n .map((dictionaryDefinition) => dictionaryDefinition.name)\n .filter((name) => !['w5s-typescript'].includes(name)),\n ],\n ignoreWords: [],\n import: toArray(defaultSettings.import).filter((dict) => !excludeImport.has(dict)),\n ignorePaths: [\n ...toArray(defaultSettings.ignorePaths),\n '**/CHANGELOG.md',\n '**/__snapshots__/**',\n // '**/.git/**',\n '**/.vscode/**',\n '**/*.snap',\n '**/dist/**',\n '**/node_modules/**',\n '**/package.json',\n '**/package-lock.json',\n '**/renovate.json',\n '**/vscode-extension/**',\n '**/yarn.lock',\n '**/pnpm-lock.yaml',\n\n // Ignore common media files\n '**/*.svg',\n '**/*.webp',\n '**/*.webm',\n ],\n languageSettings: [\n ...toArray(defaultSettings.languageSettings),\n {\n languageId: 'typescript,javascript,typescriptreact,javascriptreact',\n locale: '*',\n includeRegExpList: [],\n ignoreRegExpList: ['js-hex-escape', 'js-unicode-escape', 'js-regexp-flags'],\n patterns: [],\n dictionaries: ['w5s-typescript'],\n dictionaryDefinitions: [],\n },\n {\n languageId: 'typescript,javascript,typescriptreact,javascriptreact',\n locale: '*',\n // eslint-disable-next-line unicorn/prefer-string-raw\n ignoreRegExpList: ['\\\\/\\\\* eslint-disable.+', '\\\\/\\\\/ eslint-disable.+'],\n },\n ],\n};\n"],"mappings":";;AAAA,MAAa,OAAO,OAAO,OAAO;CAEhC,MAAA;CAEA,SAAA;CAEA,aAAa;CACd,CAAC;;;ACHF,MAAM,WAAc,UAAgC,MAAM,QAAQ,MAAM,GAAG,QAAQ,SAAS,OAAO,EAAE,GAAG,CAAC,MAAM;AAC/G,MAAM,kBAAkB;AAExB,MAAM,gCAAgB,IAAI,IAAY,EAErC,CAAC;AACF,MAAM,wBAAyE;CAC7E;EACE,UAAU;EACV,MAAM;EACN,MAAM;EACN,aAAa;EACd;CACD;EACE,UAAU;EACV,MAAM;EACN,MAAM;EACN,aAAa;EACd;CACD;EACE,UAAU;EACV,MAAM;EACN,MAAM;EACN,aAAa;EACd;CACD;EACE,UAAU;EACV,MAAM;EACN,MAAM;EACN,aAAa;EACd;CACD;EACE,UAAU;EACV,MAAM;EACN,MAAM;EACN,aAAa;EACd;CACF;AAED,MAAa,SAAiC;CAC5C,GAAG;CACH,MAAM;CACN,IAAI;CACJ,UAAU;CACV,aAAa;CACb,OAAO,EAAE;CACT,WAAW,EAAE;CACb,cAAc;CACd,uBAAuB,CAAC,GAAG,QAAQ,gBAAgB,sBAAsB,EAAE,GAAG,sBAAsB;CACpG,cAAc,CACZ,GAAG,QAAQ,gBAAgB,aAAa,EACxC,GAAG,sBACA,KAAK,yBAAyB,qBAAqB,KAAK,CACxD,QAAQ,SAAS,CAAC,CAAC,iBAAiB,CAAC,SAAS,KAAK,CAAC,CACxD;CACD,aAAa,EAAE;CACf,QAAQ,QAAQ,gBAAgB,OAAO,CAAC,QAAQ,SAAS,CAAC,cAAc,IAAI,KAAK,CAAC;CAClF,aAAa;EACX,GAAG,QAAQ,gBAAgB,YAAY;EACvC;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;EACA;EACD;CACD,kBAAkB;EAChB,GAAG,QAAQ,gBAAgB,iBAAiB;EAC5C;GACE,YAAY;GACZ,QAAQ;GACR,mBAAmB,EAAE;GACrB,kBAAkB;IAAC;IAAiB;IAAqB;IAAkB;GAC3E,UAAU,EAAE;GACZ,cAAc,CAAC,iBAAiB;GAChC,uBAAuB,EAAE;GAC1B;EACD;GACE,YAAY;GACZ,QAAQ;GAER,kBAAkB,CAAC,2BAA2B,0BAA0B;GACzE;EACF;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@w5s/cspell-config",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "CSpell configuration presets",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cspell"
|
|
@@ -23,10 +23,9 @@
|
|
|
23
23
|
"./dist/*": "./dist/*",
|
|
24
24
|
"./dict/*": "./dict/*"
|
|
25
25
|
},
|
|
26
|
-
"typings": "./dist/index.d.
|
|
26
|
+
"typings": "./dist/index.d.mts",
|
|
27
27
|
"files": [
|
|
28
28
|
"cspell-ext.json",
|
|
29
|
-
"dict/",
|
|
30
29
|
"dist/",
|
|
31
30
|
"src/",
|
|
32
31
|
"index.js",
|
|
@@ -36,36 +35,11 @@
|
|
|
36
35
|
"!**/__tests__/**"
|
|
37
36
|
],
|
|
38
37
|
"scripts": {
|
|
39
|
-
"
|
|
40
|
-
"build": "npx run-p \"build:*\"",
|
|
41
|
-
"build:tsc": "npx tsup",
|
|
42
|
-
"clean": "npx run-p \"clean:*\"",
|
|
43
|
-
"clean:tsc": "rm -rf dist",
|
|
44
|
-
"docs": "node ../../markdown.mjs",
|
|
45
|
-
"format": "npx run-p \"format:*\"",
|
|
46
|
-
"format:src": "eslint . --fix",
|
|
47
|
-
"lint": "npx run-p \"lint:*\"",
|
|
48
|
-
"lint:src": "eslint .",
|
|
49
|
-
"postpack": "npx clean-package restore",
|
|
50
|
-
"prepack": "npx clean-package",
|
|
51
|
-
"prepare": "npx run-p \"prepare:*\"",
|
|
52
|
-
"prepare:empty": ":",
|
|
53
|
-
"prepublishOnly": "npm run clean;npm run build",
|
|
54
|
-
"spellcheck": "cspell --no-progress '**'",
|
|
55
|
-
"test": "npx run-p \"test:*\"",
|
|
56
|
-
"test:src": "vitest run"
|
|
38
|
+
"postpack": "clean-package restore"
|
|
57
39
|
},
|
|
58
40
|
"dependencies": {
|
|
59
41
|
"@cspell/cspell-bundled-dicts": "^9.0.0"
|
|
60
42
|
},
|
|
61
|
-
"devDependencies": {
|
|
62
|
-
"@cspell/cspell-bundled-dicts": "9.6.4",
|
|
63
|
-
"@cspell/cspell-tools": "9.6.4",
|
|
64
|
-
"@cspell/cspell-types": "9.6.4",
|
|
65
|
-
"@w5s/tsup-config": "2.0.3",
|
|
66
|
-
"vite": "7.3.1",
|
|
67
|
-
"vitest": "4.0.18"
|
|
68
|
-
},
|
|
69
43
|
"peerDependencies": {
|
|
70
44
|
"cspell": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0"
|
|
71
45
|
},
|
|
@@ -74,7 +48,6 @@
|
|
|
74
48
|
"optional": true
|
|
75
49
|
}
|
|
76
50
|
},
|
|
77
|
-
"clean-package": "../../clean-package.config.mjs",
|
|
78
51
|
"engines": {
|
|
79
52
|
"node": ">=20.0.0"
|
|
80
53
|
},
|
|
@@ -82,5 +55,5 @@
|
|
|
82
55
|
"access": "public"
|
|
83
56
|
},
|
|
84
57
|
"sideEffect": false,
|
|
85
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "8d96574cd89109fa8268a2c77601337ad871ef1e"
|
|
86
59
|
}
|
package/src/config.ts
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { AdvancedCSpellSettings } from '@cspell/cspell-types';
|
|
2
|
+
// @ts-ignore CSpell config is not typed
|
|
3
|
+
import cSpellSettings from '@cspell/cspell-bundled-dicts/cspell-default.config.js';
|
|
4
|
+
|
|
5
|
+
const toArray = <T>(value: T | T[] | undefined) => (Array.isArray(value) ? value : value == null ? [] : [value]);
|
|
6
|
+
const defaultSettings = cSpellSettings as AdvancedCSpellSettings;
|
|
7
|
+
// eslint-disable-next-line unicorn/no-useless-collection-argument
|
|
8
|
+
const excludeImport = new Set<string>([
|
|
9
|
+
// Put here the imports you want to exclude
|
|
10
|
+
]);
|
|
11
|
+
const dictionaryDefinitions: AdvancedCSpellSettings['dictionaryDefinitions'] = [
|
|
12
|
+
{
|
|
13
|
+
addWords: false,
|
|
14
|
+
name: 'w5s-filetypes',
|
|
15
|
+
path: '../dict/filetypes.txt',
|
|
16
|
+
description: 'Additional file types',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
addWords: false,
|
|
20
|
+
name: 'w5s-fullstack',
|
|
21
|
+
path: '../dict/fullstack.txt',
|
|
22
|
+
description: 'Fullstack terms',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
addWords: false,
|
|
26
|
+
name: 'w5s-typescript',
|
|
27
|
+
path: '../dict/typescript.txt',
|
|
28
|
+
description: 'Typescript keywords',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
addWords: false,
|
|
32
|
+
name: 'w5s-names',
|
|
33
|
+
path: '../dict/names.txt',
|
|
34
|
+
description: 'Known names',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
addWords: false,
|
|
38
|
+
name: 'w5s-npm',
|
|
39
|
+
path: '../dict/npm.txt',
|
|
40
|
+
description: 'NPM packages',
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
export const config: AdvancedCSpellSettings = {
|
|
45
|
+
...defaultSettings,
|
|
46
|
+
name: 'W5S default settings .js',
|
|
47
|
+
id: 'w5s-default-js',
|
|
48
|
+
language: 'en',
|
|
49
|
+
description: 'Default cspell configuration.',
|
|
50
|
+
words: [],
|
|
51
|
+
flagWords: [],
|
|
52
|
+
useGitignore: true,
|
|
53
|
+
dictionaryDefinitions: [...toArray(defaultSettings.dictionaryDefinitions), ...dictionaryDefinitions],
|
|
54
|
+
dictionaries: [
|
|
55
|
+
...toArray(defaultSettings.dictionaries),
|
|
56
|
+
...dictionaryDefinitions
|
|
57
|
+
.map((dictionaryDefinition) => dictionaryDefinition.name)
|
|
58
|
+
.filter((name) => !['w5s-typescript'].includes(name)),
|
|
59
|
+
],
|
|
60
|
+
ignoreWords: [],
|
|
61
|
+
import: toArray(defaultSettings.import).filter((dict) => !excludeImport.has(dict)),
|
|
62
|
+
ignorePaths: [
|
|
63
|
+
...toArray(defaultSettings.ignorePaths),
|
|
64
|
+
'**/CHANGELOG.md',
|
|
65
|
+
'**/__snapshots__/**',
|
|
66
|
+
// '**/.git/**',
|
|
67
|
+
'**/.vscode/**',
|
|
68
|
+
'**/*.snap',
|
|
69
|
+
'**/dist/**',
|
|
70
|
+
'**/node_modules/**',
|
|
71
|
+
'**/package.json',
|
|
72
|
+
'**/package-lock.json',
|
|
73
|
+
'**/renovate.json',
|
|
74
|
+
'**/vscode-extension/**',
|
|
75
|
+
'**/yarn.lock',
|
|
76
|
+
'**/pnpm-lock.yaml',
|
|
77
|
+
|
|
78
|
+
// Ignore common media files
|
|
79
|
+
'**/*.svg',
|
|
80
|
+
'**/*.webp',
|
|
81
|
+
'**/*.webm',
|
|
82
|
+
],
|
|
83
|
+
languageSettings: [
|
|
84
|
+
...toArray(defaultSettings.languageSettings),
|
|
85
|
+
{
|
|
86
|
+
languageId: 'typescript,javascript,typescriptreact,javascriptreact',
|
|
87
|
+
locale: '*',
|
|
88
|
+
includeRegExpList: [],
|
|
89
|
+
ignoreRegExpList: ['js-hex-escape', 'js-unicode-escape', 'js-regexp-flags'],
|
|
90
|
+
patterns: [],
|
|
91
|
+
dictionaries: ['w5s-typescript'],
|
|
92
|
+
dictionaryDefinitions: [],
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
languageId: 'typescript,javascript,typescriptreact,javascriptreact',
|
|
96
|
+
locale: '*',
|
|
97
|
+
// eslint-disable-next-line unicorn/prefer-string-raw
|
|
98
|
+
ignoreRegExpList: ['\\/\\* eslint-disable.+', '\\/\\/ eslint-disable.+'],
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -1,103 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import cSpellSettings from '@cspell/cspell-bundled-dicts/cspell-default.config.js';
|
|
4
|
-
|
|
5
|
-
const toArray = <T>(value: T | T[] | undefined) => (Array.isArray(value) ? value : value == null ? [] : [value]);
|
|
6
|
-
const defaultSettings = cSpellSettings as AdvancedCSpellSettings;
|
|
7
|
-
// eslint-disable-next-line unicorn/no-useless-collection-argument
|
|
8
|
-
const excludeImport = new Set<string>([
|
|
9
|
-
// Put here the imports you want to exclude
|
|
10
|
-
]);
|
|
11
|
-
const dictionaryDefinitions: AdvancedCSpellSettings['dictionaryDefinitions'] = [
|
|
12
|
-
{
|
|
13
|
-
addWords: false,
|
|
14
|
-
name: 'w5s-filetypes',
|
|
15
|
-
path: '../dict/filetypes.txt',
|
|
16
|
-
description: 'Additional file types',
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
addWords: false,
|
|
20
|
-
name: 'w5s-fullstack',
|
|
21
|
-
path: '../dict/fullstack.txt',
|
|
22
|
-
description: 'Fullstack terms',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
addWords: false,
|
|
26
|
-
name: 'w5s-typescript',
|
|
27
|
-
path: '../dict/typescript.txt',
|
|
28
|
-
description: 'Typescript keywords',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
addWords: false,
|
|
32
|
-
name: 'w5s-names',
|
|
33
|
-
path: '../dict/names.txt',
|
|
34
|
-
description: 'Known names',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
addWords: false,
|
|
38
|
-
name: 'w5s-npm',
|
|
39
|
-
path: '../dict/npm.txt',
|
|
40
|
-
description: 'NPM packages',
|
|
41
|
-
},
|
|
42
|
-
];
|
|
43
|
-
|
|
44
|
-
const settings: AdvancedCSpellSettings = {
|
|
45
|
-
...defaultSettings,
|
|
46
|
-
name: 'W5S default settings .js',
|
|
47
|
-
id: 'w5s-default-js',
|
|
48
|
-
language: 'en',
|
|
49
|
-
description: 'Default cspell configuration.',
|
|
50
|
-
words: [],
|
|
51
|
-
flagWords: [],
|
|
52
|
-
useGitignore: true,
|
|
53
|
-
dictionaryDefinitions: [...toArray(defaultSettings.dictionaryDefinitions), ...dictionaryDefinitions],
|
|
54
|
-
dictionaries: [
|
|
55
|
-
...toArray(defaultSettings.dictionaries),
|
|
56
|
-
...dictionaryDefinitions
|
|
57
|
-
.map((dictionaryDefinition) => dictionaryDefinition.name)
|
|
58
|
-
.filter((name) => !['w5s-typescript'].includes(name)),
|
|
59
|
-
],
|
|
60
|
-
ignoreWords: [],
|
|
61
|
-
import: toArray(defaultSettings.import).filter((dict) => !excludeImport.has(dict)),
|
|
62
|
-
ignorePaths: [
|
|
63
|
-
...toArray(defaultSettings.ignorePaths),
|
|
64
|
-
'**/CHANGELOG.md',
|
|
65
|
-
'**/__snapshots__/**',
|
|
66
|
-
// '**/.git/**',
|
|
67
|
-
'**/.vscode/**',
|
|
68
|
-
'**/*.snap',
|
|
69
|
-
'**/dist/**',
|
|
70
|
-
'**/node_modules/**',
|
|
71
|
-
'**/package.json',
|
|
72
|
-
'**/package-lock.json',
|
|
73
|
-
'**/renovate.json',
|
|
74
|
-
'**/vscode-extension/**',
|
|
75
|
-
'**/yarn.lock',
|
|
76
|
-
'**/pnpm-lock.yaml',
|
|
77
|
-
|
|
78
|
-
// Ignore common media files
|
|
79
|
-
'**/*.svg',
|
|
80
|
-
'**/*.webp',
|
|
81
|
-
'**/*.webm',
|
|
82
|
-
],
|
|
83
|
-
languageSettings: [
|
|
84
|
-
...toArray(defaultSettings.languageSettings),
|
|
85
|
-
{
|
|
86
|
-
languageId: 'typescript,javascript,typescriptreact,javascriptreact',
|
|
87
|
-
locale: '*',
|
|
88
|
-
includeRegExpList: [],
|
|
89
|
-
ignoreRegExpList: ['js-hex-escape', 'js-unicode-escape', 'js-regexp-flags'],
|
|
90
|
-
patterns: [],
|
|
91
|
-
dictionaries: ['w5s-typescript'],
|
|
92
|
-
dictionaryDefinitions: [],
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
languageId: 'typescript,javascript,typescriptreact,javascriptreact',
|
|
96
|
-
locale: '*',
|
|
97
|
-
// eslint-disable-next-line unicorn/prefer-string-raw
|
|
98
|
-
ignoreRegExpList: ['\\/\\* eslint-disable.+', '\\/\\/ eslint-disable.+'],
|
|
99
|
-
},
|
|
100
|
-
],
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export default settings;
|
|
1
|
+
export * from './meta.js';
|
|
2
|
+
export { config as default } from './config.js';
|
package/src/meta.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const meta = Object.freeze({
|
|
2
|
+
// @ts-ignore - these variables are injected at build time
|
|
3
|
+
name: (typeof __PACKAGE_NAME__ === 'undefined' ? '' : __PACKAGE_NAME__) as string,
|
|
4
|
+
// @ts-ignore - these variables are injected at build time
|
|
5
|
+
version: (typeof __PACKAGE_VERSION__ === 'undefined' ? '' : __PACKAGE_VERSION__) as string,
|
|
6
|
+
// @ts-ignore - these variables are injected at build time
|
|
7
|
+
buildNumber: 1 as number, // (typeof __PACKAGE_BUILD_NUMBER__ === 'undefined' ? 0 : __PACKAGE_BUILD_NUMBER__) as number,
|
|
8
|
+
});
|
package/dict/filetypes.txt
DELETED
package/dict/fullstack.txt
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
autodevops
|
|
2
|
-
automerge
|
|
3
|
-
bigdecimal
|
|
4
|
-
camelcase
|
|
5
|
-
CODEOWNERS
|
|
6
|
-
datasource
|
|
7
|
-
datasources
|
|
8
|
-
editorconfig
|
|
9
|
-
esnext
|
|
10
|
-
frontends
|
|
11
|
-
githooks
|
|
12
|
-
gitmoji
|
|
13
|
-
gitmojis
|
|
14
|
-
healthcheck
|
|
15
|
-
interruptible
|
|
16
|
-
macOS
|
|
17
|
-
monoid
|
|
18
|
-
npmjs
|
|
19
|
-
postpack
|
|
20
|
-
prepack
|
|
21
|
-
stylesheet
|
|
22
|
-
subpackage
|
|
23
|
-
templating
|
package/dict/names.txt
DELETED
package/dict/npm.txt
DELETED