mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-18 00:57:51 +02:00
refactor: import jest as global; unify import style of some modules (#6898)
* refactor: import jest as global * fix react
This commit is contained in:
parent
e97dc0d37e
commit
c9ee6e467c
59 changed files with 177 additions and 139 deletions
13
.eslintrc.js
13
.eslintrc.js
|
@ -166,7 +166,12 @@ module.exports = {
|
|||
// selector:
|
||||
// @ 'ExportDefaultDeclaration > Identifier, ExportNamedDeclaration[source=null] > ExportSpecifier',
|
||||
// message: 'Export in one statement'
|
||||
// }
|
||||
// },
|
||||
...['path', 'fs-extra', 'webpack', 'lodash'].map((m) => ({
|
||||
selector: `ImportDeclaration[importKind=value]:has(Literal[value=${m}]) > ImportSpecifier[importKind=value]`,
|
||||
message:
|
||||
'Default-import this, both for readability and interoperability with ESM',
|
||||
})),
|
||||
],
|
||||
'no-template-curly-in-string': WARNING,
|
||||
'no-unused-expressions': [WARNING, {allowTaggedTemplates: true}],
|
||||
|
@ -312,5 +317,11 @@ module.exports = {
|
|||
'@typescript-eslint/explicit-module-boundary-types': OFF,
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['*.test.ts', '*.test.tsx'],
|
||||
rules: {
|
||||
'import/no-extraneous-dependencies': OFF,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue