Comments (10)
If you want to COMPLETELY ignore a file - you need to use an object with just ignores
.
Otherwise ignores
only skips the files from the specific config object
Which is why your "no typescript eslint" branch works - because you have ignores
in an object by itself.
from typescript-eslint.
While I honestly still do not understand the sentence
Otherwise ignores only skips the files from the specific config object
The flat config is an array of objects.
The final config for a file is calculated by merging the array of objects into a single object.
Which objects are used for a given file depends on the files
and ignores
patterns.
If you add ignore
to an object and the file doesn't match - then eslint will skip that config for that file.
If you have an object that just has ignores
then it is a special case which declares a global ignore list.
Please have a read through the docs for more information
https://eslint.org/docs/latest/use/configure/configuration-files#configuration-objects
from typescript-eslint.
This fixes it for me:
- ignores: ["app/myFirstApp/nestedProject/"],
+ ignores: ["app/myFirstApp/nestedProject/src/fileIdoNotWantToLint.ts"],
My hunch is there needs to be *
and/or **
s somewhere. If that's not right, I think your issue would be with ESLint core - perhaps a docs clarification/correction to be made somewhere? typescript-eslint doesn't do anything different with ignores
. tseslint.config
doesn't modify them.
Additionally, we're planning on switching the recommendation from project
to useProjectService
(today, EXPERIMENTAL_useProjectService
) in our upcoming v8 major. Which also fixes the issue.
Closing as not on our end, but if you can pinpoint a bug in our source, we'd be happy to fix it. Thanks!
from typescript-eslint.
@JoshuaKGoldberg Thank you very much for answering so quickly !
Are you sure the pattern you provided fixes the problem for you ? I have already tried it, it does not work and instead of that error I simply get the project to lint my file as if I did not ask for it to not be linted :
1:69 error 'e' is defined but never used @typescript-eslint/no-unused-vars
2:7 error 'custom_event' is never reassigned. Use 'const' instead prefer-const
✖ 2 problems (2 errors, 0 warnings)
1 error and 0 warnings potentially fixable with the `--fix` option.
Those errors were left there on purpose, by the way.
This error only happened to me when I have started using the tslint configuration - so don't you think the issue if from it ? If no, who should I report it to ?
from typescript-eslint.
What I mean by "fixing" it is that you no longer get the big ESLint was configured to run ... complaint. That complaint comes from this project, typescript-eslint.
We (typescript-eslint) act as "just" a set of extensions on top of ESLint. If you're having issues with ESLint's ignores then that'd be the ESLint project, not us.
tslint
Sorry to nitpick you, but because a lot of people get confused by this: "tslint" refers to an old linter that was deprecated a few years back. https://typescript-eslint.io/troubleshooting/tslint. We try to avoid that name because a lot of folks have a hard time understanding the difference between it and typescript-eslint. Just a heads up. 🙂
from typescript-eslint.
Thank you @JoshuaKGoldberg for the clear response, and sorry if my questions seemed repetitive as this my first time with eslint on a repository !
In order to make to make sure if the problem arises from ESLint or from typescript-eslint, I simply deleted typescript-eslint from my packages and reproduced the same project and everything was fine and worked like their documentation stated. You can checkout the new branch I made to try this out or simply read the config file.
Due to this, I would maintain that it's not core Eslint that is causing this problem. What do you think ?
from typescript-eslint.
Interesting! Thanks for trying that out. npx @eslint/config-inspector
might be useful too?
Putting this back in triage
.
from typescript-eslint.
Thank you for considering this and for npx @eslint/config-inspector
idea, I did not know about it. I will use it to investigate the problem with you guys
from typescript-eslint.
I have tried this solution on my main repository, and it worked !
While I honestly still do not understand the sentence
Otherwise ignores only skips the files from the specific config object
the solution you have provided solves the problem, thank you very much guys ! the documentation was quite confusing. If you have time you can mention it in the FAQ for future reference :) I do admit however that the problem is eslint related indeed
from typescript-eslint.
A good docs suggestion for ESLint core. 🙂
from typescript-eslint.
Related Issues (20)
- Bug: [no-unncessary-condition] Incorrectly detects possible values of type around await HOT 6
- Bug: [use-unknown-in-catch-callback-variable] Does not flag second argument of `.then` HOT 1
- Enhancement: [use-unknown-in-catch-callback-variable] Option to only check inline functions HOT 6
- Rule proposal: prefer querySelector generic vs type cast
- Enchancement: [strict-boolean-expressions] Treat `!!x` same as `Boolean(x)` HOT 6
- Enhancement: [no-floating-promises] Option to only check within async functions HOT 6
- Repo: renovate updates stuck? HOT 1
- Enhancement: [no-explicit-any] value-level only HOT 5
- Docs: no-misused-promises example for "if promise exists" HOT 3
- Bug: [consistent-indexed-object-style] shouldn't suggest `Record` when extending an another type HOT 7
- Docs: broken anchor links in "This rule accepts the following options, and has more strict settings in the strict and strict-type-checked configs." HOT 1
- Base rule extension: [accessor-pairs] HOT 5
- Docs: Better Callouts for `all` / `strict` / `strict-type-checked` Config Stability
- Docs: Consider explicitly mentioning rule report properties as not covered by semver HOT 1
- Enhancement: [no-unnecessary-condition] Check truthiness assertion functions
- Configs: Apply changes to config presets for v8 HOT 1
- Enhancement: [prefer-nullish-coalescing] should ignore Boolean constructor HOT 4
- Repo: Use ESLint v9 for our internal linting HOT 3
- feat(eslint-plugin): remove deprecated no-throw-literal rule HOT 1
- Docs: Updated typed linting docs for new project service
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typescript-eslint.