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

fix: properly enable React/recommended rules #276

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// @ts-check
import eslint from '@eslint/js'
import stylistic from '@stylistic/eslint-plugin'
import reactHook from 'eslint-plugin-react-hooks'
import reactRecommended from 'eslint-plugin-react/configs/recommended.js'
import globals from 'globals'
import tseslint from 'typescript-eslint'
import reactHook from 'eslint-plugin-react-hooks'
import stylistic from '@stylistic/eslint-plugin'

// config is a helper from typescript-eslint to provide type information for
// eslint file, similar to vite defineConfig. Fun fact: This file is also linted
Expand Down Expand Up @@ -43,9 +43,13 @@ const config = tseslint.config(
},
{
// These files are React specific. Applying this is similar to extends
// 'plugin:react/recommended' and apply plugin 'react' and 'react-hooks'
// 'plugin:react/recommended' and apply plugin 'react'
...reactRecommended,
files: ['src/**/*.{jsx,tsx}'],
},
{
// Also apply plugin 'react-hooks'
files: ['src/**/*.{jsx,tsx}'],
languageOptions: {
parserOptions: {
ecmaFeatures: {
Expand Down Expand Up @@ -91,7 +95,6 @@ const config = tseslint.config(
/**
* @param {RuleLevel} level
* @return {StylisticRules | ESLintRules}
*
*/
function styleRules(level) {
return {
Expand Down
Loading