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

Unknown options: extensions, useEslintrc #287

Closed
DamienCassou opened this issue Apr 10, 2024 · 9 comments
Closed

Unknown options: extensions, useEslintrc #287

DamienCassou opened this issue Apr 10, 2024 · 9 comments

Comments

@DamienCassou
Copy link
Contributor

$ npx eslint_d .
Error: Invalid Options:
- Unknown options: extensions, useEslintrc
- 'extensions' has been removed.

$ npx eslint_d --version
v8.57.0 (eslint_d v13.1.2)

$ npx eslint
...
works fine
@ahmafi
Copy link

ahmafi commented Apr 11, 2024

Same problem here. I have this config file:

{
  "env": {
    "browser": true,
    "es2021": true
  },
  "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "ecmaVersion": "latest",
    "sourceType": "module"
  },
  "plugins": ["@typescript-eslint"],
  "rules": {}
}

@Amar-Gill
Copy link

I'm getting the same error when I'm in a project using the new flat config.

eslint_d version 13.1.2

@pedro757
Copy link

I believe this isn't compatible with eslint v9

@damrath
Copy link

damrath commented May 16, 2024

I believe this isn't compatible with eslint v9

You're right, it's stated in the readme that eslint_d supports up to version 8 of ESLint.

@afaikiac
Copy link

afaikiac commented May 23, 2024

Works fine for me with eslint 9 and env ESLINT_USE_FLAT_CONFIG=true.

env ESLINT_USE_FLAT_CONFIG=true eslint_d restart

or export this env in your .profile for example

@mantoni mantoni mentioned this issue Jul 28, 2024
@mantoni
Copy link
Owner

mantoni commented Jul 28, 2024

This is probably obsolete with the new major v14.0.0 (see #294). Should you're still having the issue, please write here and I'm happy to re-open.

@mantoni mantoni closed this as completed Jul 28, 2024
@juangbc
Copy link

juangbc commented Sep 19, 2024

still having this issue

@juangbc
Copy link

juangbc commented Sep 19, 2024

Error: Invalid Options:
- Unknown options: extensions, ignorePath, reportUnusedDisableDirectives, resolvePluginsRelativeTo, rulePaths, useEslintrc
- 'extensions' has been removed.
- 'resolvePluginsRelativeTo' has been removed.
- 'ignorePath' has been removed.
- 'rulePaths' has been removed. Please define your rules using plugins.
- 'reportUnusedDisableDirectives' has been removed. Please use the 'overrideConfig.linterOptions.reportUnusedDisableDirectives' option instead.

And this is the config file:

import js from "@eslint/js";
import typescriptEslint from "@typescript-eslint/eslint-plugin"; // TypeScript plugin
import tsParser from "@typescript-eslint/parser"; // TypeScript parser
import unusedImports from "eslint-plugin-unused-imports"; // Plugin to remove unused imports and variables

export default [
  js.configs.recommended,
  {
    files: ["**/*.ts", "**/*.tsx"],
    ignores: [
      "node_modules/",
      "dist/",
      "coverage/",
      "public/",
      "postcss.config.js",
      "tailwind.config.js",
      "vite.config.ts"
    ],
  },
  {
    languageOptions: {
      parser: tsParser, // Use TypeScript parser
      ecmaVersion: 2021, // Supports modern JavaScript features
      sourceType: "module", // Use ECMAScript modules
      parserOptions: {
        project: './tsconfig.json', // Point to the TypeScript config file
      },
    },
    plugins: {
      "@typescript-eslint": typescriptEslint, // Add TypeScript ESLint plugin
      "unused-imports": unusedImports, // Plugin for auto-removing unused imports/variables
    },
    rules: {
      // Disable ESLint's default no-unused-vars rule to prevent conflict
      "no-unused-vars": "off",

      // Use eslint-plugin-unused-imports to handle unused variables and imports
      "unused-imports/no-unused-imports": "error",
      "unused-imports/no-unused-vars": [
        "error",
        {
          vars: "all", // Check all variables
          varsIgnorePattern: "^_", // Ignore variables starting with an underscore
          args: "after-used", // Only check arguments after they are used
          argsIgnorePattern: "^_", // Ignore arguments starting with an underscore
        },
      ],

      // TypeScript-specific rules (using @typescript-eslint)
      "@typescript-eslint/no-unused-vars": "off", // Disable @typescript-eslint's version of the rule

      // Common linting rules
      "no-console": "warn", // Warn on console usage
      "eqeqeq": ["error", "always"], // Enforce strict equality checks
      "curly": "error", // Require curly braces for control statements
      "quotes": ["error", "single"], // Enforce single quotes
      "semi": ["error", "always"], // Require semicolons
      "no-var": "error", // Disallow var, prefer const or let
      "prefer-const": "error", // Prefer const over let where possible
    },
  },
];

@juangbc
Copy link

juangbc commented Sep 19, 2024

Linting in the terminal works, the extension inside the ide (intellij) does not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants