-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: upgrade ESLint to use new flat config
With ESLint 9 being out and plugins slowly migrating, this takes care of the migration of ESLint config from package.json to its own eslint.config.mjs. This is needed as package.json and .eslintrc is deprecated
- Loading branch information
Showing
4 changed files
with
56 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright Contributors to the Packit project. | ||
// SPDX-License-Identifier: MIT | ||
|
||
import eslint from "@eslint/js"; | ||
import * as react from "eslint-plugin-react"; | ||
import tseslint from "typescript-eslint"; | ||
|
||
export default tseslint.config( | ||
eslint.configs.recommended, | ||
...tseslint.configs.recommended, | ||
{ | ||
settings: { | ||
react: { | ||
version: "detect", | ||
}, | ||
}, | ||
plugins: { | ||
react, | ||
"@typescript-eslint": tseslint.plugin, | ||
}, | ||
languageOptions: { | ||
parser: tseslint.parser, | ||
parserOptions: { | ||
project: "./tsconfig.json", | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
}, | ||
rules: { | ||
"import/no-anonymous-default-export": "off", | ||
"react/no-unescaped-entities": "off", | ||
"react/prop-types": "off", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ | ||
args: "all", | ||
argsIgnorePattern: "^_", | ||
caughtErrors: "all", | ||
caughtErrorsIgnorePattern: "^_", | ||
destructuredArrayIgnorePattern: "^_", | ||
varsIgnorePattern: "^_", | ||
ignoreRestSiblings: true, | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}", "**/*.stories.*"], | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters