Comments (2)
Hi @mctrafik, thanks for the issue!
This works as intended. If the configuration object has other keys, ignores
limits which files the configuration object applies to:
https://eslint.org/docs/latest/use/configure/configuration-files-new#excluding-files-with-ignores
To ignore files, ignores
should be used without any other keys in the configuration object:
In your example, the configuration would be:
import tseslint from 'typescript-eslint';
/** @type {import('@typescript-eslint/utils').TSESLint.FlatConfig.ConfigArray} */
const configs = [
{
ignores: ['**/dist'],
},
{
files: ['ts', 'tsx', 'cts', 'ctsx', 'mts', 'mtsx', 'js', 'cjs', 'mjs'].map(
(ext) => `src/**/*.${ext}`
),
plugins: {
'@typescript-eslint': tseslint.plugin,
},
languageOptions: {
globals: Object.fromEntries(
['jest', 'it', 'describe', 'test', 'expect'] // Jest
.concat(['window', 'document', 'setTimeout', 'setInterval']) // DOM
.map((key) => [key, true])
),
ecmaVersion: 2022,
parser: tseslint.parser,
parserOptions: {
project: ['./tsconfig.json'],
sourceType: 'module',
tsconfigRootDir: import.meta.dirname,
},
},
},
];
export default configs;
https://stackblitz.com/edit/stackblitz-starters-7dk5wd?file=eslint.config.mjs
from eslint.
I see there's a way to exclude it, but the for record, the fact that the config file species no other ignores, and those ignores are ignored is extremely counter-intuitive
.
from eslint.
Related Issues (20)
- Rule Change: Add suggestion fixer to no-case-declarations HOT 4
- The Eslint command is failing with error "Oops! Something went wrong! :( ESLint: 9.0.0 Error: Could not find config file." This is referring from file https://github.com/eslint/eslint/blob/main/lib/eslint/eslint.js HOT 4
- New Rule: prefer-structured-clone HOT 1
- Bug: npm init @eslint/config generates broken-by-default config file HOT 2
- Rule Change: `no-restricted-exports` to accept Regex patterns HOT 7
- Bug: defining a global named `__defineSetter__` doesn't work HOT 1
- Init wizard not generating flat config HOT 8
- Bug: v9.0.0 has prevented ancestor glob patterns HOT 5
- Change Request: Some tweaks to getFunctionHeadLoc HOT 3
- Bug: flat configs are processing ignored directories and applying rules that were scoped to other directories HOT 1
- Bug: ESLint never stops when analyzing linter issues in the project HOT 17
- Docs: `no-unreachable` is not necessarily handled by TypeScript HOT 1
- Bug: eslint v8 with flat config and airbnb-base throws cryptic error
- Docs: custom rule tutorial doesn't work with v9 HOT 1
- Scheduled release for May 3rd, 2024 HOT 2
- Change Request: Make it easier to inherit flat configs from the repo root HOT 12
- This method cannot be used with flat config. Add your entries directly into the config array. HOT 1
- Docs: context migration suggestions fail on earlier v8 versions
- Bug: (Config (unnamed): Unexpected key "baseDirectory" found.) HOT 1
- 📈 Tracking: ESLint v9 support HOT 5
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 eslint.