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
18 changes: 15 additions & 3 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import cloudFourConfig from '@cloudfour/eslint-config';
import * as mdx from 'eslint-plugin-mdx';
import react from 'eslint-plugin-react';

export default [
{
Expand Down Expand Up @@ -50,10 +49,8 @@ export default [
],
},
},
plugins: { react },
rules: {
'padding-line-between-statements': 'off',
'react/jsx-uses-vars': 'error',
},
},

Expand Down Expand Up @@ -94,6 +91,21 @@ export default [
rules: {
// The auto-fixer for this rule does not work with .mdx files.
'import/order': 'off',
// Our docs pages import Storybook's doc components and their own stories
// module, then reference them only inside JSX:
//
// import { Canvas, Meta } from '@storybook/addon-docs/blocks';
// import * as AlertStories from './alert.stories.js';
// <Meta of={AlertStories} />
//
// `no-unused-vars` does not treat a JSX reference as a use, so it reports
// every one of those imports -- 171 of them across 83 files. We used to
// silence that with `react/jsx-uses-vars` from eslint-plugin-react, but
// that package supports ESLint 9 at most and was blocking our upgrade to
// 10, so it is gone. The trade-off is that a genuinely unused import in an
// .mdx file no longer gets reported. These are documentation pages, so
// that is a cheap price for dropping a dependency.
'no-unused-vars': 'off',
},
},

Expand Down
Loading