Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions .github/workflows/_static-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
- name: Run ESLint
run: npm run eslint

- name: Run TypeScript type checking
run: npm run typecheck

- name: Run Prettier
run: npm run prettier

Expand Down
34 changes: 21 additions & 13 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { fileURLToPath } from 'node:url';
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import pluginReact from 'eslint-plugin-react';
import eslintReact from '@eslint-react/eslint-plugin';
import eslintConfigPrettier from 'eslint-config-prettier';
import * as mdx from 'eslint-plugin-mdx';

Expand All @@ -19,7 +19,19 @@ export default [

pluginJs.configs.recommended,
...tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
{
...eslintReact.configs['recommended-typescript'],
rules: {
...eslintReact.configs['recommended-typescript'].rules,
// Preserve checks from eslint-plugin-react's recommended preset.
'@eslint-react/no-missing-component-display-name': 'error',
'@eslint-react/no-missing-context-display-name': 'error',
'@eslint-react/jsx-no-children-prop': 'error',
'@eslint-react/jsx-no-comment-textnodes': 'error',
'@eslint-react/dom-no-unknown-property': 'error',
'@eslint-react/dom-no-unsafe-target-blank': 'error',
},
},
eslintConfigPrettier,

// Configs for .mdx files
Expand All @@ -31,8 +43,10 @@ export default [
}),
rules: {
...mdx.flat.rules,
'react/no-unescaped-entities': 'off',
'react/jsx-no-undef': ['error', { allowGlobals: true }],
// ESLint 10 tracks JSX component references, including MDX globals.
'no-undef': 'error',
Comment thread
danbarr marked this conversation as resolved.
// MDX JSX expressions compile into the page component's render body.
'@eslint-react/rules-of-hooks': 'off',
'mdx/remark': 'off', // remark-lint's auto-fix clobbers MDX formatting
},
languageOptions: {
Expand All @@ -56,18 +70,12 @@ export default [
// Config for _partials with JSX props
{
files: ['docs/**/_partials/*.mdx'],
languageOptions: {
globals: { props: 'readonly' },
},
rules: {
'no-unused-expressions': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'no-undef': 'off',
},
},

{
settings: {
react: {
version: 'detect',
},
},
},
];
Loading
Loading