Issue with configuration loading in project with workspace/mono-repo structure
See original GitHub issueInfo
Kind of Issue
- runtime - command-line tools
- building / compiling
- security
- change in behavior
- crash / error
Which Tool or library
- cspell – the command-line spelling tool
- cspell-tools – used for building dictionary files
- cspell-lib – library that does the actual spell checking.
- cspell-trie – tool for working with trie files.
Which Version
Version: 5.6.6
Issue with supporting library?
- No
- cspell-glob – library for matching glob patterns
- cspell-io – thin file i/o library
- cspell-trie-lib - trie lib
- cspell-trie2-lib - trie lib alternate format
OS:
- Macos
- Linux
- Windows
- Other
version:
OS version if applicable.
Bug Description
Describe the bug
With a project structure like this:
/client
/src
/ignore-me
file.json
file.ts
cspell.config.js
cspell.config.js
Running a command like npx cspell client/src/ignore-me/file.json -v
gives output similar to the following:
cspell;
Date: Wed, 23 Jun 2021 18:01:45 GMT
Options:
verbose: Yes
config: default
exclude: node_modules/**
files: client/src/ignore-me/file.json
wordsOnly: No
unique: No
Config Files Found:
D:\Programming\Projects\x\front-end\cspell.config.js
Exclusion Globs:
Glob: package-lock.json from D:\Programming\Projects\x\front-end\cspell.config.js
Glob: node_modules/** from command line
Checking: D:\Programming\Projects\x\front-end\client\src\ignore-me\file.json, File type: auto, Language: default
Checked: D:\Programming\Projects\x\front-end\client\src\ignore-me\file.json, File type: json, Language: en-GB ... Issues: 1 0.587S
Config file Used: d:\Programming\Projects\x\front-end\client\cspell.config.js
Dictionaries Used: backwards-compatibility, typescript, aws, companies, cryptocurrencies, en-gb, filetypes, softwareTerms, node, npm
Config file Used
is not listed under Config Files Found
, and the ignorePaths
from the “used config file” (client\cspell.config.js
) are not included under Exclusion Globs
. The file is not ignored as expected.
To Reproduce
Steps to reproduce the behavior:
- Create a project structure similar to that described above.
- Run
npx cspell
from the root directory referencing a file under theclient
directory that should be ignored. - Observe that the file is not ignored, as expected.
Expected behavior
The config file under the client
directory should be used, which includes the ignore-me
directory under ignorePaths
.
Screenshots
n/a
Additional context
n/a
cspell.config.js
Root:
"use strict";
module.exports = /** @type {import("@cspell/cspell-types").FileSettings} */ ({
version: "0.1",
language: "en-GB",
files: ["/*.{js,json,md}", "/.*.js"],
ignorePaths: ["package-lock.json"],
ignoreWords: []
});
Client:
"use strict";
module.exports = /** @type {import("@cspell/cspell-types").FileSettings} */ ({
version: "0.1",
language: "en-GB",
dictionaries: ["typescript"],
files: ["**/*.{html,js,json,md,scss,ts,vue}", "/.*.js"],
ignorePaths: ["public/assets/", "src/ignore-me/"],
ignoreWords: []
});
Example Repository (Optional)
(on request)
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (1 by maintainers)
Top GitHub Comments
Ah! I didn’t see the version change in the changelog. It seems to be working! 🎉
Thank you.
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.