Skip to content
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

Enhancement: Add an option to CSpell ESLint plugin to be able to use ignorePaths found in CSpell config. #7078

Open
1 task done
thasmo opened this issue Mar 25, 2025 · 3 comments

Comments

@thasmo
Copy link

thasmo commented Mar 25, 2025

Kind of Issue

Runtime - command-line tools

Tool or Library

cspell/eslint-plugin

Version

  • cspell 8.17.5
  • @cspell/eslint-plugin 8.17.5

Supporting Library

No response

OS

Windows

OS Version

  • Windows 11
  • WSL 2.4.12.0
  • Ubuntu 24.04.2

Description

Running cspell CLI works as expected, but eslint seems to ignore ignorePaths.

Running pnpm cspell . yields success:

CSpell: Files checked: 83, Issues found: 0 in 0 files.

Running pnpm eslint . yields an error:

/home/user/project/src/locales/de.ts

Mind that the custom dictionaryDefinitions works as expected via CLI and eslint, no issues there. Only ignorePaths doesn't seem to work at all via eslint plugin.

Steps to Reproduce

No response

Expected Behavior

ignorePaths works via eslint plugin.

Additional Information

No response

cspell.config.js

export default {
	dictionaries: ['project'],
	dictionaryDefinitions: [
		{
			addWords: true,
			name: 'project',
			path: 'dictionary.txt',
		},
	],
	ignorePaths: [
		'src/locales/',
	],
	language: 'en',
	version: '0.2',
};

Example Repository

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@thasmo thasmo changed the title [Bug]: ignorePaths is not working as expected with eslint plugin [Bug]: ignorePaths is not working via eslint plugin Mar 25, 2025
@Jason3S
Copy link
Collaborator

Jason3S commented Mar 26, 2025

@thasmo,

It was a design decision to use ESLint's files and ignores as the sole selector on when to apply the CSpell lint rule.

This issue highlights that some documentation is needed.

@thasmo
Copy link
Author

thasmo commented Mar 26, 2025

@Jason3S, I see. But shouldn't it be possible to set a relevant ignores value based on the ignorePaths option via the plugin? If possible, that would be some neat DX.

@Jason3S
Copy link
Collaborator

Jason3S commented Mar 26, 2025

@thasmo,

I can see it as an option.

@Jason3S Jason3S changed the title [Bug]: ignorePaths is not working via eslint plugin Enhancement: Add an option to CSpell ESLint plugin to be able to use ignorePaths found in CSpell config. Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants