Coder Social home page Coder Social logo

Comments (4)

paulocoghi avatar paulocoghi commented on May 18, 2024

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 .eslintrc.js to eslint.config.js (without changing anything inside it), I received the error:

Oops! Something went wrong! :(

ESLint: 9.0.0

You are linting "{src,apps,libs,test}/**/*.ts", but all of the files matching the glob pattern "{src,apps,libs,test}/**/*.ts" are ignored.

If you don't want to lint these files, remove the pattern "{src,apps,libs,test}/**/*.ts" from the list of arguments passed to ESLint.

If you do want to lint these files, try the following solutions:

* Check your .eslintignore file, or the eslintIgnore property in package.json, to ensure that the files are not configured to be ignored.
* Explicitly list the files from this glob that you'd like to lint on the command-line, rather than providing a glob as an argument.

Here is my eslint.config.js:

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,
      },
    },
  },
};

from eslint.

mdjermanovic avatar mdjermanovic commented on May 18, 2024

Link to Minimal Reproducible Example

https://github.com/coderesolution/boilerplate

I'm getting 404 on this link, perhaps the repo is private. Can you provide another repo where we could reproduce this?

from eslint.

elliottmangham avatar elliottmangham commented on May 18, 2024

Link to Minimal Reproducible Example

https://github.com/coderesolution/boilerplate

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.

from eslint.

nzakas avatar nzakas commented on May 18, 2024

@elliottmangham @paulocoghi neither of your examples are valid eslint.config.js files. Please see the migration guide for help in converting your config file.

@paulocoghi please create a StackBlitz or GitHub repo with a minimal reproduction so we can take a look.

from eslint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.