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

Eslint config 9.0 migration #164

Merged
merged 12 commits into from
Sep 5, 2024
30 changes: 0 additions & 30 deletions .eslintrc.cjs

This file was deleted.

69 changes: 69 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import reactPlugin from 'eslint-plugin-react'; // https://github.com/jsx-eslint/eslint-plugin-react?tab=readme-ov-file#configuration
import globals from 'globals';
import pluginJs from '@eslint/js';
import tsEslint from 'typescript-eslint';
import jsxA11y from 'eslint-plugin-jsx-a11y';
import tailwind from 'eslint-plugin-tailwindcss';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';

export default [
pluginJs.configs.recommended,
jsxA11y.flatConfigs.recommended,
...tsEslint.configs.strict,
...tsEslint.configs.stylistic,
eslintPluginPrettierRecommended,
...tailwind.configs['flat/recommended'],
{
name: 'tailwind-migration',
files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'],
rules: {
'tailwindcss/no-custom-classname': 0,
},
},
{
name: 'ignore-outputs',
ignores: ['**/build/', '**/dist/', '**/node_modules/', '**/.next/'],
},
{
name: 'react',
files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'],
...reactPlugin.configs.flat.recommended,
languageOptions: {
...reactPlugin.configs.flat.recommended.languageOptions,
globals: globals.browser,
parserOptions: {
ecmaFeatures: { jsx: true },
},
},
rules: {
'react/react-in-jsx-scope': 0,
'react/jsx-uses-react': 0,
},
},
{
name: 'ts-migration-relax',
files: ['**/*.{ts,tsx}'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-empty-function': 'off',
},
},
{
name: 'ts-unused-vars',
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
// ignoreRestSiblings: true, - if you want to ignore unused rest siblings
},
],
},
},
];
Loading
Loading