-
-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: import config not working with @cspell/dict-fr-fr
in a subdirectory since v8.1.0
#5034
Comments
I'll take a look. Relative imports are expected to work. |
I'm not able to reproduce the issue. Just to be clear, your repository looks like this?
|
So far it is not possible to reproduce.
That's correct. And we are calling cspell from the root directory using yarn like this: ❯ yarn --cwd frontend spellcheck
yarn run v1.22.21
$ cspell -c '../.cspell.json' -r '..' --no-progress --dot --gitignore "**/*.{php,js,jsx,ts,tsx,json,yml}"
Configuration Error: Failed to resolve file: "node_modules/@cspell/dict-fr-fr/cspell-ext.json"
CSpell: Files checked: 1247, Issues found: 0 in 0 files
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. frontend/package.json {
"name": "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}\"",
},
"devDependencies": {
"@cspell/dict-fr-fr": "2.2.2",
"cspell": "8.1.0"
}
} Repo heirarchy:
|
This is what I have here: https://github.com/streetsidesoftware/cspell/pull/5035/files |
Do you have any other The spell checker will search for the nearest config file when spell checking file. Please try adding |
@Jason3S that was the issue. I didn't realize I had a second File path: Used to work before v8.1.0: {
"import": ["node_modules/@cspell/dict-fr-fr/cspell-ext.json"],
"language": "en,fr"
} Works as of v8.1.0: {
"import": ["@cspell/dict-fr-fr/cspell-ext.json"],
"language": "en,fr"
} |
That is good news. The way the imported path was resolved changed to support ESM Module imports. If the path had been I'll see if it reasonable to bring back the old behavior. |
So far it is not possible to reproduce.
This is great, thanks for your help @Jason3S |
The fix is in |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Kind of Issue
Runtime - command-line tools
Tool or Library
cspell
Version
v8.1.0
Supporting Library
No response
OS
ALL
OS Version
No response
Description
After v8.1.0 we receive the error Configuration Error: Failed to resolve file: "node_modules/@cspell/dict-fr-fr/cspell-ext.json"
The import path appears to be incorrect given what we are providing in the config.
Steps to Reproduce
frontend
Expected Behavior
Behavior should not change between v8.0.0 (working) and v8.1.0 (not working). There is no release note indicating that cspell no longer supports relative config imports from a subdirectory.
The path
node_modules/@cspell/dict-fr-fr/cspell-ext.json
is incorrect and not what is being supplied in the config. It should be./frontend/node_modules/@cspell/dict-fr-fr/cspell-ext.json
Additional Information
Test cases should be added for this common scenario to prevent future regression
cspell.json
cspell.config.yaml
No response
Example Repository
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: