mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-05 12:22:45 +02:00
chore: upgrade TypeScript & other ESLint related deps (#5963)
* chore: upgrade ESLint related deps * Upgrade TS * Fix lock * Bump Babel * Update config
This commit is contained in:
parent
2f7d6fea1e
commit
0374426ce3
104 changed files with 2662 additions and 2487 deletions
23
.eslintrc.js
23
.eslintrc.js
|
@ -31,7 +31,6 @@ module.exports = {
|
|||
'plugin:react-hooks/recommended',
|
||||
'airbnb',
|
||||
'prettier',
|
||||
'prettier/react',
|
||||
],
|
||||
settings: {
|
||||
'import/resolver': {
|
||||
|
@ -61,6 +60,7 @@ module.exports = {
|
|||
},
|
||||
],
|
||||
'import/extensions': OFF,
|
||||
'no-restricted-exports': OFF,
|
||||
'header/header': [
|
||||
ERROR,
|
||||
'block',
|
||||
|
@ -90,6 +90,14 @@ module.exports = {
|
|||
'react/prefer-stateless-function': WARNING,
|
||||
'react/jsx-props-no-spreading': OFF,
|
||||
'react/require-default-props': [ERROR, {ignoreFunctionalComponents: true}],
|
||||
'react/function-component-definition': [
|
||||
WARNING,
|
||||
{
|
||||
namedComponents: 'function-declaration',
|
||||
unnamedComponents: 'arrow-function',
|
||||
},
|
||||
],
|
||||
'react/no-unstable-nested-components': [WARNING, {allowAsProps: true}],
|
||||
'@typescript-eslint/no-inferrable-types': OFF,
|
||||
'import/first': OFF,
|
||||
'import/order': OFF,
|
||||
|
@ -104,19 +112,16 @@ module.exports = {
|
|||
'no-unused-vars': OFF,
|
||||
'no-nested-ternary': WARNING,
|
||||
'@typescript-eslint/no-empty-function': OFF,
|
||||
'@typescript-eslint/no-non-null-assertion': OFF, // Have to use type assertion anyways
|
||||
'@typescript-eslint/no-non-null-assertion': OFF,
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
ERROR,
|
||||
{argsIgnorePattern: '^_', ignoreRestSiblings: true},
|
||||
],
|
||||
'@typescript-eslint/explicit-module-boundary-types': WARNING,
|
||||
'@typescript-eslint/ban-ts-comment': [
|
||||
ERROR,
|
||||
{'ts-expect-error': 'allow-with-description'},
|
||||
],
|
||||
|
||||
// TODO re-enable some these as errors
|
||||
// context: https://github.com/facebook/docusaurus/pull/2949
|
||||
'@typescript-eslint/ban-types': WARNING,
|
||||
'import/no-extraneous-dependencies': ERROR,
|
||||
'no-useless-escape': WARNING,
|
||||
'prefer-template': WARNING,
|
||||
|
@ -189,6 +194,12 @@ module.exports = {
|
|||
'import/no-duplicates': OFF,
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['*.ts', '*.tsx'],
|
||||
rules: {
|
||||
'import/no-import-module-exports': OFF,
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['*.js'],
|
||||
rules: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue