diff --git a/packages/cspell-lib/src/lib/Settings/Controller/configLoader/configLoader.test.ts b/packages/cspell-lib/src/lib/Settings/Controller/configLoader/configLoader.test.ts index 177b09249b7..cb8c01b2f3a 100644 --- a/packages/cspell-lib/src/lib/Settings/Controller/configLoader/configLoader.test.ts +++ b/packages/cspell-lib/src/lib/Settings/Controller/configLoader/configLoader.test.ts @@ -415,8 +415,8 @@ describe('Validate search/load config files', () => { }); test.each` - dir | expectedImports - ${new URL('issue-5034/cspell.json', urlIssues).href} | ${[oc({ filename: sm(/cspell.config.yaml/) }), oc({ filename: sm(/cspell-ext.json/) }), oc({ filename: sm(/cspell.json/) })]} + dir | expectedImports + ${new URL('issue-5034/.cspell.json', urlIssues).href} | ${[oc({ filename: sm(/cspell-ext.json/) }), oc({ filename: sm(/.cspell.json/) })]} `('Search and merge from $dir', async ({ dir, expectedImports }) => { const loader = getDefaultConfigLoader(); const url = toFileUrl(dir); diff --git a/packages/cspell-lib/src/lib/util/resolveFile.test.ts b/packages/cspell-lib/src/lib/util/resolveFile.test.ts index 5f7bcf66c84..878a05a2416 100644 --- a/packages/cspell-lib/src/lib/util/resolveFile.test.ts +++ b/packages/cspell-lib/src/lib/util/resolveFile.test.ts @@ -82,11 +82,11 @@ describe('Validate resolveFile', () => { const urlIssue5034 = new URL('issue-5034/', issuesFolderURL); test.each` - filename | relativeTo | expected | found - ${'./nested/cspell.config.yaml'} | ${urlIssue5034.href} | ${sm(/nested[/\\]cspell\.config\.yaml$/)} | ${true} - ${'./nested/cspell.config.yaml'} | ${new URL('cspell.json', urlIssue5034).href} | ${sm(/nested[/\\]cspell\.config\.yaml$/)} | ${true} - ${'./nested/cspell.config.yaml'} | ${fileURLToPath(urlIssue5034)} | ${sm(/nested[/\\]cspell\.config\.yaml$/)} | ${true} - ${'./nested/node_modules/@cspell/dict-fr-fr/cspell-ext.json'} | ${urlIssue5034.href} | ${sm(/cspell-ext\.json$/)} | ${true} + filename | relativeTo | expected | found + ${'./frontend/cfg/cspell.config.yaml'} | ${urlIssue5034.href} | ${sm(/cfg[/\\]cspell\.config\.yaml$/)} | ${true} + ${'./frontend/cfg/cspell.config.yaml'} | ${new URL('cspell.json', urlIssue5034).href} | ${sm(/cfg[/\\]cspell\.config\.yaml$/)} | ${true} + ${'./frontend/cfg/cspell.config.yaml'} | ${fileURLToPath(urlIssue5034)} | ${sm(/cfg[/\\]cspell\.config\.yaml$/)} | ${true} + ${'./frontend/node_modules/@cspell/dict-fr-fr/cspell-ext.json'} | ${urlIssue5034.href} | ${sm(/cspell-ext\.json$/)} | ${true} `('resolveFile $filename rel $relativeTo', async ({ filename, relativeTo, expected, found }) => { const r = resolveFile(filename, relativeTo); // console.error('r %o', r); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b25c546061a..250d3bd7447 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -800,6 +800,17 @@ importers: specifier: ^0.19.8 version: 0.19.8 + test-fixtures/issues/issue-5034: {} + + test-fixtures/issues/issue-5034/frontend: + devDependencies: + '@cspell/dict-fr-fr': + specifier: 2.2.2 + version: 2.2.2 + cspell: + specifier: workspace:* + version: link:../../../../packages/cspell + test-packages/cspell-dictionary/test-cspell-dictionary: dependencies: cspell-dictionary: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 6d5b8a39ef0..0460cd1be34 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -5,6 +5,8 @@ packages: - "test-packages/*/*" - "test-packages/*/*/bin" - "test-packages/*/*/source" + - "test-fixtures/issues/issue-5034" + - "test-fixtures/issues/issue-5034/frontend" - doc-generator - integration-tests - scripts diff --git a/test-fixtures/issues/issue-5034/.cspell.json b/test-fixtures/issues/issue-5034/.cspell.json new file mode 100644 index 00000000000..1911ab32a16 --- /dev/null +++ b/test-fixtures/issues/issue-5034/.cspell.json @@ -0,0 +1,126 @@ +{ + "version": "0.2", + "ignorePaths": [ + ".neoconf.json", + ".vscode/settings.json", + ".vim/coc-settings.json", + "frontend/node_modules/**", + "frontend/coverage/**", + "frontend/build/**", + "frontend/db/dist/**", + "frontend/package.json", + "frontend/public/locales/ar/**", + "frontend/public/locales/zgh/**", + "frontend/public/supportedBrowsers.js", + "docker-compose*.yml", + "cloudformation.yml", + "vendor", + "web/src/composer.json", + "web/src/vendor", + "web/src/shared/scripts", + "web/src/css", + "web/src/locales/ar/translations.yml", + "node/src/locales/ar.json", + "web/src/locales/zgh/translations.yml", + "web/src/api/Validation/lang/ar/validation.php", + ".env", + "renovate.json", + "web/conf/**/*", + "*Dockerfile" + ], + "allowCompoundWords": true, + "ignoreWords": [ + "culturehq", + "yiisoft", + "lintstagedrc", + "rehype", + "noto", + "graphiql", + "webp" + ], + "words": [ + "AMZN", + "capce", + "cedata", + "crunz", + "cronitor", + "destructured", + "droppable", + "entityid", + "esetnik", + "esnext", + "falsey", + "Gravatar", + "hacky", + "Handtevy", + "hocs", + "iframe", + "imgix", + "immer", + "junit", + "jwplayer", + "JWPLAYER", + "Lngs", + "luxon", + "Maknz", + "Mebibytes", + "msodbcsql", + "newid", + "noopener", + "NREMT", + "nuka", + "oems", + "onstatechange", + "onupdatefound", + "phpcs", + "phpcbf", + "phuocng", + "recertification", + "reduxjs", + "resizer", + "signup", + "testid", + "tamazight", + "tifinagh", + "tsql", + "Tuupola", + "unmount", + "unregister", + "UPDLOCK", + "wdyr", + "xlarge" + ], + "import": [ + "./frontend/node_modules/@cspell/dict-fr-fr/cspell-ext.json" + ], + "overrides": [ + { + "filename": "**/*.md", + "language": "en,fr" + }, + { + "filename": "**/locales/fr/**/{*.json,*.yml}", + "language": "en,fr" + }, + { + "filename": "**/__test__/**", + "language": "en,fr" + }, + { + "filename": "**/{*.test.ts,*.test.tsx}", + "language": "en,fr" + }, + { + "filename": "**/Validation/lang/fr/validation.php", + "language": "en,fr" + }, + { + "filename": "node/src/locales/fr.json", + "language": "en,fr" + }, + { + "filename": "frontend/src/themes/*.json", + "languageId": "css" + } + ] +} diff --git a/test-fixtures/issues/issue-5034/cspell.json b/test-fixtures/issues/issue-5034/cspell.json deleted file mode 100644 index e3043811d37..00000000000 --- a/test-fixtures/issues/issue-5034/cspell.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "import": [ - "./nested/cspell.config.yaml", - "./nested/node_modules/@cspell/dict-fr-fr/cspell-ext.json" - ] -} diff --git a/test-fixtures/issues/issue-5034/frontend/README.md b/test-fixtures/issues/issue-5034/frontend/README.md new file mode 100644 index 00000000000..9c137ecd83d --- /dev/null +++ b/test-fixtures/issues/issue-5034/frontend/README.md @@ -0,0 +1,9 @@ +# Read me + +Related to [#5034](https://github.com/streetsidesoftware/cspell/issues/5034) + +bon après-midi + + diff --git a/test-fixtures/issues/issue-5034/nested/cspell.config.yaml b/test-fixtures/issues/issue-5034/frontend/cfg/cspell.config.yaml similarity index 100% rename from test-fixtures/issues/issue-5034/nested/cspell.config.yaml rename to test-fixtures/issues/issue-5034/frontend/cfg/cspell.config.yaml diff --git a/test-fixtures/issues/issue-5034/frontend/package.json b/test-fixtures/issues/issue-5034/frontend/package.json new file mode 100644 index 00000000000..8d48a466979 --- /dev/null +++ b/test-fixtures/issues/issue-5034/frontend/package.json @@ -0,0 +1,14 @@ +{ + "name": "issue-5034-frontend", + "version": "2.34.4", + "private": true, + "dependencies": {}, + "scripts": { + "spellcheck": "cspell -c '../.cspell.json' -r '..' --no-progress --dot --gitignore \"**/*.{js,jsx,ts,tsx,json,yml,md}\"", + "test": "pnpm run spellcheck" + }, + "devDependencies": { + "@cspell/dict-fr-fr": "2.2.2", + "cspell": "workspace:*" + } +} diff --git a/test-fixtures/issues/issue-5034/nested/node_modules/@cspell/dict-fr-fr/cspell-ext.json b/test-fixtures/issues/issue-5034/nested/node_modules/@cspell/dict-fr-fr/cspell-ext.json deleted file mode 100644 index 4017f417977..00000000000 --- a/test-fixtures/issues/issue-5034/nested/node_modules/@cspell/dict-fr-fr/cspell-ext.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "id": "cspell-ext", - "words": [ - "après-midi" - ] -} diff --git a/test-fixtures/issues/issue-5034/package.json b/test-fixtures/issues/issue-5034/package.json index 0967ef424bc..01fbbd0e2a4 100644 --- a/test-fixtures/issues/issue-5034/package.json +++ b/test-fixtures/issues/issue-5034/package.json @@ -1 +1,10 @@ -{} +{ + "name": "issue-5034", + "version": "2.34.4", + "private": true, + "dependencies": {}, + "scripts": { + "test": "yarn --cwd frontend spellcheck" + }, + "devDependencies": {} +}