2017-04-14 09:26:27 +02:00
module . exports = {
2017-05-26 14:10:52 +02:00
root : true ,
2021-11-11 16:06:51 +01:00
extends : [ '@storybook/eslint-config-storybook' , 'plugin:storybook/recommended' ] ,
2021-02-16 18:57:43 +01:00
rules : {
'@typescript-eslint/ban-ts-comment' : 'warn' ,
2021-11-23 17:30:12 -08:00
'jest/no-standalone-expect' : [
'error' ,
{ additionalTestBlockFunctions : [ 'it.skipWindows' , 'it.onWindows' ] } ,
] ,
2022-04-25 15:22:02 +02:00
'no-use-before-define' : 'off' ,
2021-02-16 18:57:43 +01:00
} ,
2018-02-17 22:33:31 +03:00
overrides : [
2022-02-11 16:01:20 +01:00
{
// this package depends on a lot of peerDependencies we don't want to specify, because npm would install them
files : [ '**/addons/docs/**/*' ] ,
rules : {
'import/no-extraneous-dependencies' : 'off' ,
} ,
} ,
2022-04-25 15:22:02 +02:00
{
// this package depends on a lot of peerDependencies we don't want to specify, because npm would install them
files : [ '**/*.ts' , '**/*.tsx' ] ,
rules : {
'no-shadow' : 'off' ,
'@typescript-eslint/ban-types' : 'warn' , // should become error, in the future
} ,
} ,
2022-01-28 15:27:20 +01:00
{
// this package uses pre-bundling, dependencies will be bundled, and will be in devDepenencies
files : [
'**/lib/theming/**/*' ,
'**/lib/router/**/*' ,
'**/lib/ui/**/*' ,
'**/lib/components/**/*' ,
] ,
rules : {
'import/no-extraneous-dependencies' : [ 'error' , { bundledDependencies : false } ] ,
} ,
} ,
2018-11-19 17:21:53 +01:00
{
2019-04-05 04:58:14 +02:00
files : [
'**/__tests__/**' ,
2020-02-13 10:58:37 +08:00
'**/__testfixtures__/**' ,
2019-04-25 17:59:37 +02:00
'**/*.test.*' ,
'**/*.stories.*' ,
2019-04-05 04:58:14 +02:00
'**/storyshots/**/stories/**' ,
] ,
2018-11-19 17:21:53 +01:00
rules : {
2019-11-15 15:37:14 +02:00
'@typescript-eslint/no-empty-function' : 'off' ,
'import/no-extraneous-dependencies' : 'off' ,
2018-11-19 17:21:53 +01:00
} ,
} ,
2020-04-10 07:49:54 +08:00
{
files : [ '**/__testfixtures__/**' ] ,
rules : {
'react/forbid-prop-types' : 'off' ,
'react/no-unused-prop-types' : 'off' ,
'react/require-default-props' : 'off' ,
} ,
} ,
2019-11-15 15:37:14 +02:00
{ files : '**/.storybook/config.js' , rules : { 'global-require' : 'off' } } ,
2020-05-09 11:34:50 +02:00
{ files : 'cypress/**' , rules : { 'jest/expect-expect' : 'off' } } ,
2019-04-25 17:59:37 +02:00
{
files : [ '**/*.stories.*' ] ,
rules : {
2019-11-15 15:37:14 +02:00
'no-console' : 'off' ,
2019-04-25 17:59:37 +02:00
} ,
} ,
{
files : [ '**/*.tsx' , '**/*.ts' ] ,
rules : {
2020-11-26 16:55:47 +01:00
'react/require-default-props' : 'off' ,
2019-11-15 15:37:14 +02:00
'react/prop-types' : 'off' , // we should use types
2020-11-26 16:55:47 +01:00
'react/forbid-prop-types' : 'off' , // we should use types
2019-11-15 15:37:14 +02:00
'no-dupe-class-members' : 'off' , // this is called overloads in typescript
2022-01-19 13:54:39 +01:00
'react/no-unused-prop-types' : 'off' , // we should use types
'react/default-props-match-prop-types' : 'off' , // we should use types
'import/no-named-as-default' : 'warn' ,
'import/no-named-as-default-member' : 'warn' ,
'react/destructuring-assignment' : 'warn' ,
// This warns about importing interfaces and types in a normal import, it's arguably better to import with the `type` prefix separate from the runtime imports,
// I leave this as a warning right now because we haven't really decided yet, and the codebase is riddled with errors if I set to 'error'.
// It IS set to 'error' for JS files.
'import/named' : 'warn' ,
2019-04-25 17:59:37 +02:00
} ,
} ,
2019-04-25 23:59:40 +02:00
{
files : [ '**/*.d.ts' ] ,
rules : {
2019-11-15 15:37:14 +02:00
'vars-on-top' : 'off' ,
'no-var' : 'off' , // this is how typescript works
'spaced-comment' : 'off' ,
2019-04-25 23:59:40 +02:00
} ,
} ,
2020-07-22 19:37:21 +02:00
{
files : [ '**/mithril/**/*' ] ,
rules : {
'react/no-unknown-property' : 'off' , // Need to deactivate otherwise eslint replaces some unknown properties with React ones
} ,
} ,
2018-02-17 22:33:31 +03:00
] ,
2017-06-06 13:18:33 +02:00
} ;