question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with configuration loading in project with workspace/mono-repo structure

See original GitHub issue

Info

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:

  1. Create a project structure similar to that described above.
  2. Run npx cspell from the root directory referencing a file under the client directory that should be ignored.
  3. 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:closed
  • Created 2 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
glen-84commented, Jul 1, 2021

Ah! I didn’t see the version change in the changelog. It seems to be working! 🎉

Thank you.

0reactions
github-actions[bot]commented, Aug 14, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Case for Monorepos: A sane Workspace Setup (Part 2)
Learn how to setup dev tooling in a monorepo, run tasks efficiently, release multiple packages and overcome common DevOps challenges.
Read more >
Unable to use Storybook as expected in a monorepo #5949
I expected to see a working storybook with stories from all of my packages in it. Code snippets. webpack.config.js. module.exports = (baseConfig ...
Read more >
A Guide to Monorepos for Front-end Code - Toptal
A monorepo or monorepository is a code management and architectural concept whereby you keep all your isolated bits of code inside one super...
Read more >
Working with monorepos - Expo Documentation
This guide will set up a simple monorepo with an Expo project. We currently have first-class support for Yarn 1 (Classic) workspaces.
Read more >
A guide through The Wild Wild West of setting up a mono repo ...
Let's enable Yarn workspaces in our mono repo. First, go to your lerna.json file and add the following fields to your configuration: npmClient...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found