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
Bug: v9.0.0 has prevented ancestor glob patterns #18370
Comments
I'm having the same bug, or at least a similar one. After updating from ESLint 8.57.0 to 9.0.0 and moving
Here is my const isFixMode = process.argv.includes("--fix");
module.exports = {
parser: "@typescript-eslint/parser",
extends: [
"xo",
"xo-space",
"xo-typescript",
"prettier",
"plugin:import/typescript",
"plugin:unicorn/recommended",
"plugin:prettier/recommended",
],
ignorePatterns: ["**/dist/*", "**/node_modules/*"],
overrides: [
{
plugins: ["jest"],
files: [
"test/**/*.ts",
"tests/**/*.ts",
"**/*.spec.ts",
],
rules: {
"@typescript-eslint/no-unsafe-assignment": "off",
"max-nested-callbacks": "off",
"jest/no-focused-tests": "error",
...(isFixMode && {
"jest/no-focused-tests": "warn",
}),
},
},
],
parserOptions: {
ecmaVersion: 2021,
sourceType: "module",
},
env: {
commonjs: true,
es6: true,
node: true,
jest: true,
},
plugins: [
"@typescript-eslint",
"import",
"unused-imports",
"unicorn",
"prettier",
],
rules: {
"prettier/prettier": ["error"],
"@typescript-eslint/member-ordering": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-return": "off",
"no-console": "off",
"@typescript-eslint/ban-types": "off",
"comma-dangle": ["error", "always-multiline"],
"unicorn/no-new-array": "off",
"unicorn/no-reduce": "off",
"unicorn/no-array-reduce": "off",
"unicorn/prevent-abbreviations": [
"error",
{
replacements: {
props: false,
args: false,
params: false,
env: false,
},
},
],
"import/prefer-default-export": "off",
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error",
"import/no-unresolved": "error",
"import/order": [
"error",
{
"newlines-between": "always",
alphabetize: { order: "asc" },
groups: ["builtin", "external", "internal", "parent", "sibling"],
},
],
"unused-imports/no-unused-imports-ts": "error",
"unused-imports/no-unused-vars-ts": [
"warn",
{
vars: "all",
varsIgnorePattern: "^_",
args: "after-used",
argsIgnorePattern: "^_",
},
],
"@typescript-eslint/naming-convention": [
"error",
{
selector: ["variable"],
modifiers: ["const"],
format: ["strictCamelCase", "StrictPascalCase", "UPPER_CASE"],
leadingUnderscore: "allow",
},
],
"new-cap": "off",
},
settings: {
"import/ignore": ["node_modules"],
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"],
},
"import/resolver": {
typescript: {
alwaysTryTypes: true,
},
},
},
}; |
I'm getting 404 on this link, perhaps the repo is private. Can you provide another repo where we could reproduce this? |
Hey so sorry I posted this just before I left for vacation. I can create a reproduction mid May when I am back at the studio. Glad to see another user has had the same issue though. |
@elliottmangham @paulocoghi neither of your examples are valid @paulocoghi please create a StackBlitz or GitHub repo with a minimal reproduction so we can take a look. |
Environment
Node version: v21.7.2
npm version: v10.5.0
Local ESLint version: 9.1.0
Global ESLint version: 9.1.0
Operating System: darwin 23.4.0
What parser are you using?
@babel/eslint-parser
What did you do?
I used to simply run
eslint '../assets/source/scripts/**/*.js'
and it worked perfectly. Since updating to ES Lint v9.0.0, however, it no longer works.Below is my
eslint.config.js
file (formerly.eslintrc.js
), which hasn't changed besides the file name.What did you expect to happen?
It should run ES Lint on all JS files in my
../assets/source/scripts/
directory as per my glob pattern../assets/source/scripts/**/*.js
.What actually happened?
I get the following error:
Link to Minimal Reproducible Example
https://github.com/coderesolution/boilerplate
Participation
Additional comments
Please observe the
../
at the beginning, as the JS files are in the parent folder where I run my scripts and where mypackage.json
file is. I have noticed that if I removed the../
and reference JS files in the same directory or below, it works. Interesting, if I reference a single file above, like../assets/source/scripts/app.js
, this works.This suggests that something in v9.0.0 has prevented ancestor directories/files from linting if combined with a glob pattern like
**/*.js
.The text was updated successfully, but these errors were encountered: