Skip to content

Commit 33d6677

Browse files
committed
tidy up, fix linter
1 parent f236059 commit 33d6677

31 files changed

+705
-1660
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ In the project directory, you can run:
2525
which runs the storybook dev server.
2626

2727
Make a new branch and add your new components, tests and stories in the relevant directories and view them in your local storybook.
28-
When you are ready to share your new component, add it to the rollup.config.js following the existing syntax and it will be transpiled and presented as a module export by the build command. Up the version number in package.json and then make a pull request for review.
28+
When you are ready to share your new component, add it to the index.js following the existing syntax and it will be bundled and presented as a module export by the build command. Up the version number in package.json and then make a pull request for review.
2929

3030
## Build, Test, Package and Deploy
3131
The build and tests will run automatically on commits to your branch if you have a pull request open.

eslint.config.cjs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
2+
const storybook = require("eslint-plugin-storybook");
3+
const react = require('eslint-plugin-react');
4+
const globals = require('globals');
5+
const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended');
6+
const reactHooks = require('eslint-plugin-react-hooks');
7+
const unusedImports = require('eslint-plugin-unused-imports');
8+
9+
module.exports = [
10+
{
11+
files: ['**/*.{js,jsx,mjs,cjs,ts,tsx,test.js,stories.js}'],
12+
plugins: {
13+
react,
14+
'react-hooks': reactHooks,
15+
'unused-imports': unusedImports,
16+
storybook
17+
},
18+
languageOptions: {
19+
parserOptions: {
20+
ecmaFeatures: {
21+
jsx: true
22+
}
23+
},
24+
globals: {
25+
...globals.browser
26+
}
27+
},
28+
rules: {
29+
// ... any rules you want
30+
'react/jsx-uses-react': 'error',
31+
'react/jsx-uses-vars': 'error',
32+
'react-hooks/rules-of-hooks': 'error',
33+
'react-hooks/exhaustive-deps': 'warn',
34+
'no-unused-vars': 'error'
35+
}
36+
},
37+
eslintPluginPrettierRecommended
38+
];

0 commit comments

Comments
 (0)