Skip to content

Commit

Permalink
chore(eslint): update to version 9 (#753)
Browse files Browse the repository at this point in the history
Removed the smart-quote plugin as it was incompatible with the new
version of eslint and looked outdated.
  • Loading branch information
brentswisher committed May 10, 2024
1 parent 22bce73 commit e13824d
Show file tree
Hide file tree
Showing 6 changed files with 193 additions and 171 deletions.
8 changes: 0 additions & 8 deletions .eslintignore

This file was deleted.

89 changes: 0 additions & 89 deletions .eslintrc.js

This file was deleted.

Binary file modified .yarn/install-state.gz
Binary file not shown.
110 changes: 110 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
import js from '@eslint/js';
import babelParser from '@babel/eslint-parser';
import reactPlugin from 'eslint-plugin-react';
import prettierPlugin from 'eslint-plugin-prettier';
import storybookPlugin from 'eslint-plugin-storybook';
import typeScriptEsLint from '@typescript-eslint/eslint-plugin';
import globals from 'globals';

const pharosConfig = {
ignores: [
'node_modules/',
'dist/',
'lib/',
'.storybook-static/',
'packages/pharos/coverage/**/*.js',
'packages/pharos/src/styles/**/*.ts',
'packages/pharos-site/public/',
'packages/pharos-site/.cache/',
'**/*.css.ts',
],
languageOptions: {
parser: babelParser,
globals: {
...globals.browser,
...globals.node,
},
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
requireConfigFile: false,
ecmaFeatures: {
jsx: true,
},
babelOptions: {
plugins: ['@babel/plugin-syntax-import-assertions'],
presets: ['@babel/preset-react'],
},
},
},
plugins: {
reactPlugin,
prettierPlugin,
storybookPlugin,
typeScriptEsLint,
},
settings: {
react: {
version: 'detect',
},
},
rules: {
'react/react-in-jsx-scope': 'off',
},
};

const tsConfig = {
files: ['*.ts'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './packages/**/tsconfig.json',
},
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:wc/recommended',
'plugin:lit/recommended',
],
rules: {
'no-unused-vars': 'off',
'@typescript-eslint/consistent-type-imports': ['error'],
'@typescript-eslint/no-unused-vars': ['error'],
'lit/no-legacy-template-syntax': 'off',
},
};

const tsxConfig = {
files: ['*.tsx'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './packages/**/tsconfig.json',
},
extends: [
'plugin:jsx-a11y/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:@typescript-eslint/recommended',
],
rules: {
'no-unused-vars': 'off',
'@typescript-eslint/consistent-type-imports': ['error'],
'@typescript-eslint/no-unused-vars': ['error'],
'react/display-name': 'off',
'react/prop-types': 'off',
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
},
};

const mdxConfig = {
files: ['*.mdx'],
extends: ['plugin:mdx/recommended', 'plugin:react/recommended'],
settings: {
'mdx/code-blocks': true,
},
rules: {
'react/no-unescaped-entities': 'off',
'react/jsx-no-undef': 'off',
},
};

export default [js.configs.recommended, pharosConfig, tsConfig, tsxConfig, mdxConfig];
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,17 @@
"all-contributors-cli": "^6.26.1",
"concurrently": "^8.2.2",
"cssnano": "^7.0.1",
"eslint": "^8.57.0",
"eslint": "^9.2.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-lit": "^1.12.0",
"eslint-plugin-mdx": "^1.17.1",
"eslint-plugin-no-smart-quotes": "^1.3.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-storybook": "^0.8.0",
"eslint-plugin-wc": "^2.1.0",
"globals": "^15.2.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"lit": "^2.8.0",
Expand Down

0 comments on commit e13824d

Please sign in to comment.