storybook/.eslintrc.js

61 lines
1.6 KiB
JavaScript
Raw Normal View History

2017-04-17 16:37:37 +02:00
const ignore = 0;
2019-04-25 17:59:37 +02:00
module.exports = {
2017-05-26 14:10:52 +02:00
root: true,
2019-09-26 17:49:50 +02:00
extends: ['@storybook/eslint-config-storybook'],
2019-10-03 11:08:40 +02:00
rules: {
'import/extensions': [
'error',
'never',
{ ignorePackages: true, md: 'always', svg: 'always', json: 'always', tag: 'always' },
],
'import/no-unresolved': [2, { ignore: ['@storybook'] }],
'react/state-in-constructor': ignore,
'react/static-property-placement': ignore,
'react/jsx-props-no-spreading': ignore,
'react/jsx-fragments': ignore,
'@typescript-eslint/ban-ts-ignore': ignore,
'@typescript-eslint/no-object-literal-type-assertion': ignore,
'react/sort-comp': 'warn',
'max-classes-per-file': ignore,
},
2018-02-17 22:33:31 +03:00
overrides: [
{
files: [
'**/__tests__/**',
2019-04-25 17:59:37 +02:00
'**/*.test.*',
'**/*.stories.*',
'**/storyshots/**/stories/**',
'docs/src/new-components/lib/StoryLinkWrapper.js',
'docs/src/stories/**',
],
rules: {
2019-10-03 11:08:40 +02:00
'@typescript-eslint/no-empty-function': ignore,
'import/no-extraneous-dependencies': ignore,
},
},
{ files: '**/.storybook/config.js', rules: { 'global-require': ignore } },
2019-04-25 17:59:37 +02:00
{
files: ['**/*.stories.*'],
rules: {
'no-console': ignore,
},
},
{
files: ['**/*.tsx', '**/*.ts'],
rules: {
'react/prop-types': ignore, // we should use types
'no-dupe-class-members': ignore, // this is called overloads in typescript
},
},
2019-04-25 23:59:40 +02:00
{
files: ['**/*.d.ts'],
rules: {
'vars-on-top': ignore,
2019-04-25 23:59:40 +02:00
'no-var': ignore, // this is how typescript works
'spaced-comment': ignore,
2019-04-25 23:59:40 +02:00
},
},
2018-02-17 22:33:31 +03:00
],
};