Eslint Storybook Configuration with Typescript Support
- Install the correct version of package, which are listed by the command:
npm install "@sanv/eslint-config-stories-typescript" --save-dev
- Add next line to your
.eslintrc.js
:
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['prettier', 'react', 'jsx-a11y', '@typescript-eslint'],
parserOptions: {
project: './tsconfig.json',
sourceType: 'module',
},
extends: [
'@sanv/eslint-config-stories-typescript',
'plugin:prettier/recommended',
'prettier/react',
'prettier/@typescript-eslint',
],
}