Skip to content

Commit

Permalink
feat!: Upgrade to CSpell 7 (#2745)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S authored Aug 24, 2023
1 parent 91a3c46 commit 5a60904
Show file tree
Hide file tree
Showing 90 changed files with 694 additions and 332 deletions.
6 changes: 4 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const config = {
// 'plugin:unicorn/recommended',
],
parserOptions: {
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
ecmaVersion: 2021, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
},
ignorePatterns: [
Expand Down Expand Up @@ -67,6 +67,8 @@ const config = {
// '@typescript-eslint/no-non-null-assertion': 'off',
// '@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': ['warn', { ignoreRestSiblings: true, argsIgnorePattern: '^_' }],
'node/no-missing-import': 'off',
'import/no-unresolved': 'off',
},
},
{
Expand Down Expand Up @@ -99,7 +101,7 @@ const config = {
},
},
{
files: ['**/jest.config.js'],
files: ['**/jest.config.js', '**/*.test.*'],
rules: {
'node/no-unpublished-require': 'off',
},
Expand Down
4 changes: 2 additions & 2 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
!packages/_server/dist/main.cjs
!packages/_server/package.json

!packages/_serverPatternMatcher/dist/api.js
!packages/_serverPatternMatcher/dist/main.js
!packages/_serverPatternMatcher/dist/api.cjs
!packages/_serverPatternMatcher/dist/main.cjs
!packages/_serverPatternMatcher/package.json

!packages/client/dist/**/*.js
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@
"type": "string"
},
"ignoreRegExpList": {
"description": "List of regular expression patterns or pattern names to exclude from spell checking.\n\nExample: [\"href\"] - to exclude html href.\n\nBy default, several patterns are excluded. See [Configuration](https://cspell.org/configuration/#cspelljson-sections) for more details.\n\nWhile you can create your own patterns, you can also leverage several patterns that are [built-in to CSpell](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell-lib/src/Settings/DefaultSettings.ts#L22).",
"description": "List of regular expression patterns or pattern names to exclude from spell checking.\n\nExample: `[\"href\"]` - to exclude html href pattern.\n\nRegular expressions use JavaScript regular expression syntax.\n\nExample: to ignore ALL-CAPS words\n\nJSON ```json \"ignoreRegExpList\": [\"/\\\\b[A-Z]+\\\\b/g\"] ```\n\nYAML ```yaml ignoreRegExpList: - >- /\\b[A-Z]+\\b/g ```\n\nBy default, several patterns are excluded. See [Configuration](https://cspell.org/configuration/patterns) for more details.\n\nWhile you can create your own patterns, you can also leverage several patterns that are [built-in to CSpell](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html).",
"items": {
"description": "A PatternRef is a Pattern or PatternId.",
"type": "string"
Expand All @@ -711,7 +711,7 @@
"type": "array"
},
"includeRegExpList": {
"description": "List of regular expression patterns or defined pattern names to match for spell checking.\n\nIf this property is defined, only text matching the included patterns will be checked.\n\nWhile you can create your own patterns, you can also leverage several patterns that are [built-in to CSpell](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell-lib/src/Settings/DefaultSettings.ts#L22).",
"description": "List of regular expression patterns or defined pattern names to match for spell checking.\n\nIf this property is defined, only text matching the included patterns will be checked.\n\nWhile you can create your own patterns, you can also leverage several patterns that are [built-in to CSpell](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html).",
"items": {
"description": "A PatternRef is a Pattern or PatternId.",
"type": "string"
Expand Down Expand Up @@ -884,7 +884,7 @@
"type": "string"
},
"ignoreRegExpList": {
"description": "List of regular expression patterns or pattern names to exclude from spell checking.\n\nExample: [\"href\"] - to exclude html href.\n\nBy default, several patterns are excluded. See [Configuration](https://cspell.org/configuration/#cspelljson-sections) for more details.\n\nWhile you can create your own patterns, you can also leverage several patterns that are [built-in to CSpell](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell-lib/src/Settings/DefaultSettings.ts#L22).",
"description": "List of regular expression patterns or pattern names to exclude from spell checking.\n\nExample: `[\"href\"]` - to exclude html href pattern.\n\nRegular expressions use JavaScript regular expression syntax.\n\nExample: to ignore ALL-CAPS words\n\nJSON ```json \"ignoreRegExpList\": [\"/\\\\b[A-Z]+\\\\b/g\"] ```\n\nYAML ```yaml ignoreRegExpList: - >- /\\b[A-Z]+\\b/g ```\n\nBy default, several patterns are excluded. See [Configuration](https://cspell.org/configuration/patterns) for more details.\n\nWhile you can create your own patterns, you can also leverage several patterns that are [built-in to CSpell](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html).",
"items": {
"description": "A PatternRef is a Pattern or PatternId.",
"type": "string"
Expand All @@ -899,7 +899,7 @@
"type": "array"
},
"includeRegExpList": {
"description": "List of regular expression patterns or defined pattern names to match for spell checking.\n\nIf this property is defined, only text matching the included patterns will be checked.\n\nWhile you can create your own patterns, you can also leverage several patterns that are [built-in to CSpell](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell-lib/src/Settings/DefaultSettings.ts#L22).",
"description": "List of regular expression patterns or defined pattern names to match for spell checking.\n\nIf this property is defined, only text matching the included patterns will be checked.\n\nWhile you can create your own patterns, you can also leverage several patterns that are [built-in to CSpell](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html).",
"items": {
"description": "A PatternRef is a Pattern or PatternId.",
"type": "string"
Expand Down Expand Up @@ -1677,7 +1677,7 @@
"type": "string"
},
"ignoreRegExpList": {
"description": "List of regular expression patterns or pattern names to exclude from spell checking.\n\nExample: [\"href\"] - to exclude html href.\n\nBy default, several patterns are excluded. See [Configuration](https://cspell.org/configuration/#cspelljson-sections) for more details.\n\nWhile you can create your own patterns, you can also leverage several patterns that are [built-in to CSpell](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell-lib/src/Settings/DefaultSettings.ts#L22).",
"description": "List of regular expression patterns or pattern names to exclude from spell checking.\n\nExample: `[\"href\"]` - to exclude html href pattern.\n\nRegular expressions use JavaScript regular expression syntax.\n\nExample: to ignore ALL-CAPS words\n\nJSON ```json \"ignoreRegExpList\": [\"/\\\\b[A-Z]+\\\\b/g\"] ```\n\nYAML ```yaml ignoreRegExpList: - >- /\\b[A-Z]+\\b/g ```\n\nBy default, several patterns are excluded. See [Configuration](https://cspell.org/configuration/patterns) for more details.\n\nWhile you can create your own patterns, you can also leverage several patterns that are [built-in to CSpell](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html).",
"items": {
"description": "A PatternRef is a Pattern or PatternId.",
"type": "string"
Expand All @@ -1692,7 +1692,7 @@
"type": "array"
},
"includeRegExpList": {
"description": "List of regular expression patterns or defined pattern names to match for spell checking.\n\nIf this property is defined, only text matching the included patterns will be checked.\n\nWhile you can create your own patterns, you can also leverage several patterns that are [built-in to CSpell](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell-lib/src/Settings/DefaultSettings.ts#L22).",
"description": "List of regular expression patterns or defined pattern names to match for spell checking.\n\nIf this property is defined, only text matching the included patterns will be checked.\n\nWhile you can create your own patterns, you can also leverage several patterns that are [built-in to CSpell](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html).",
"items": {
"description": "A PatternRef is a Pattern or PatternId.",
"type": "string"
Expand Down Expand Up @@ -2588,10 +2588,10 @@
"vitest": "^0.34.2"
},
"dependencies": {
"@cspell/cspell-bundled-dicts": "^6.31.3",
"@cspell/cspell-types": "^6.31.3",
"@cspell/cspell-bundled-dicts": "^7.0.1",
"@cspell/cspell-types": "^7.0.1",
"@types/react": "^17.0.64",
"cspell": "^6.31.3",
"cspell": "^7.0.1",
"regexp-worker": "^2.0.2"
},
"comment-resolutions": {
Expand Down
1 change: 1 addition & 0 deletions packages/__locale-resolver/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.packages.base.json",
"compilerOptions": {
"types": ["node", "jest"],
"outDir": "dist",
"rootDir": "src"
},
Expand Down
1 change: 1 addition & 0 deletions packages/__utils/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.packages.base.json",
"compilerOptions": {
"types": ["node", "jest"],
"outDir": "dist",
"rootDir": "src"
},
Expand Down
1 change: 0 additions & 1 deletion packages/_integrationTests/src/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { Stream, stream } from 'kefir';
import * as vscode from 'vscode';

import { OnSpellCheckDocumentStep } from '../../_server/dist/api';
// eslint-disable-next-line import/no-unresolved
import { CSpellClient } from '../../client/dist/client';
import { ExtensionApi } from './ExtensionApi';
import { activateExtension, chalk, getDocUri, loadDocument, log, sampleWorkspaceUri, sleep } from './helper';
Expand Down
4 changes: 2 additions & 2 deletions packages/_server/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async function buildAll() {
const configs = [
{
absWorkingDir: __dirname,
entryPoints: ['src/main.ts'],
entryPoints: ['src/main.mts'],
bundle: true,
minify,
platform: 'node',
Expand All @@ -49,7 +49,7 @@ async function buildAll() {
bundle: true,
minify,
platform: 'node',
outfile: 'dist/api.js',
outfile: 'dist/api.cjs',
sourcemap: true,
},
];
Expand Down
25 changes: 14 additions & 11 deletions packages/_server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,26 @@
"bin": {
"build": "./build.mjs"
},
"type": "module",
"main": "dist/main.cjs",
"typings": "dist/main.d.ts",
"exports": {
".": "./dist/main.cjs",
"./api": "./dist/api.js"
"./api": "./dist/api.cjs"
},
"typesVersions": {
">=4.0": {
"*": {
"*": [
"dist/*",
"*"
]
}
},
"devDependencies": {
"@cspell/cspell-types": "^6.31.3",
"@cspell/cspell-types": "^7.0.1",
"@types/micromatch": "^4.0.2",
"@types/yargs": "17.0.24",
"common-utils": "1.0.0",
"cspell-glob": "^6.31.3",
"cspell-lib": "^6.31.3",
"gensequence": "^5.0.2",
"iconv-lite": "^0.6.3",
"lorem-ipsum": "^2.0.8",
Expand All @@ -50,24 +49,28 @@
"yargs": "^17.7.2"
},
"dependencies": {
"@cspell/cspell-bundled-dicts": "^6.31.3",
"cspell-gitignore": "^6.31.3"
"@cspell/cspell-bundled-dicts": "^7.0.1",
"cspell-gitignore": "^7.0.1",
"cspell-glob": "^7.0.1",
"cspell-lib": "^7.0.1"
},
"scripts": {
"build": "yarn run build:esbuild && yarn run build:api && yarn run build-schema",
"build": "yarn run build:esbuild && yarn run build:api && yarn run build:tsc && yarn run build-schema",
"build-production": "yarn run clean-build-production",
"build-schema": "ts-json-schema-generator --no-top-ref --expose none --path src/config/cspellConfig/cspellConfig.ts --type SpellCheckerSettingsVSCode --validation-keywords markdownDescription --validation-keywords scope --validation-keywords patternErrorMessage --validation-keywords deprecationMessage --validation-keywords enumDescriptions --validation-keywords deprecated --validation-keywords order -o spell-checker-config.schema.json",
"build-schema": "ts-json-schema-generator --no-top-ref --expose none --path src/config/cspellConfig/cspellConfig.mts --type SpellCheckerSettingsVSCode --validation-keywords markdownDescription --validation-keywords scope --validation-keywords patternErrorMessage --validation-keywords deprecationMessage --validation-keywords enumDescriptions --validation-keywords deprecated --validation-keywords order -o spell-checker-config.schema.json",
"build:production": "yarn run build:esbuild --production && yarn run build:api && yarn run build-schema",
"build:esbuild": "node ./build.mjs",
"build:api": "tsc -p tsconfig.api.json",
"build:tsc": "tsc -p tsconfig.test.json",
"clean-build-production": "yarn run clean && yarn run build:production",
"clean-build": "yarn run clean && yarn run build",
"clean": "shx rm -rf dist temp out coverage",
"test-watch": "vitest",
"test": "vitest run",
"watch": "concurrently \"yarn:watch:esbuild\" \"yarn:watch:api\"",
"watch": "concurrently yarn:watch:esbuild yarn:watch:api yarn:watch:tsc",
"watch:esbuild": "yarn build:esbuild --watch",
"watch:api": "yarn build:api --watch"
"watch:api": "yarn build:api --watch",
"watch:tsc": "yarn build:tsc --watch"
},
"engines": {
"node": ">=16"
Expand Down
2 changes: 1 addition & 1 deletion packages/_server/sampleSourceFiles/cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
],
"overrides": [
{
"filename": "**/documentSettings.test.ts",
"filename": "**/documentSettings.test.*",
"language": "en-gb"
}
],
Expand Down
Loading

0 comments on commit 5a60904

Please sign in to comment.