Skip to content

Commit

Permalink
Update eslint config to the latest
Browse files Browse the repository at this point in the history
  • Loading branch information
csandman committed Dec 17, 2024
1 parent 1931f67 commit 26e7649
Show file tree
Hide file tree
Showing 9 changed files with 540 additions and 860 deletions.
10 changes: 0 additions & 10 deletions .eslintignore

This file was deleted.

89 changes: 0 additions & 89 deletions .eslintrc

This file was deleted.

89 changes: 89 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import js from "@eslint/js";
import prettier from "eslint-config-prettier";
import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import globals from "globals";
import tseslint from "typescript-eslint";

export default tseslint.config(
{
ignores: [
"**/node_modules/",
"**/dist/",
"codemod/**/*.js",
"codemod/**/*.d.ts",
"demo/**/*",
"eslint.config.mjs",
],
},
{
settings: {
react: { version: "19" },
},
extends: [js.configs.recommended, ...tseslint.configs.recommended],
languageOptions: {
globals: globals.browser,
ecmaVersion: 2020,
sourceType: "module",
parserOptions: {
project: "./tsconfig.eslint.json",
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
react,
"react-hooks": reactHooks,
},
rules: {
...react.configs.recommended.rules,
...react.configs["jsx-runtime"].rules,
...reactHooks.configs.recommended.rules,
curly: ["error", "all"],
"no-console": "error",
"react/function-component-definition": [
"error",
{
namedComponents: "arrow-function",
unnamedComponents: "arrow-function",
},
],
"react/jsx-filename-extension": [
"error",
{
extensions: [".tsx"],
},
],
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/consistent-type-imports": [
"warn",
{
prefer: "type-imports",
disallowTypeAnnotations: true,
},
],
"@typescript-eslint/no-deprecated": "warn",
"@typescript-eslint/no-unused-vars": [
"error",
{
ignoreRestSiblings: true,
},
],
},
},
{
files: ["src/select/*.tsx"],
rules: {
"react/display-name": "off",
},
},
{
files: ["codemod/**/*.ts"],
rules: {
"no-console": "off",
"@typescript-eslint/no-require-imports": "off",
},
},
prettier
);
Loading

0 comments on commit 26e7649

Please sign in to comment.