Explorar el Código

Disable ESLint prefer-default-export globally (#8577)

- default / named exports are used in varying places and it is not a critical blocker for future code
- disable this rule and in the future it can be re-assessed or moved to the core wagtail eslint config
LB (Ben Johnston) hace 2 años
padre
commit
9a04aefe9a
Se han modificado 3 ficheros con 2 adiciones y 3 borrados
  1. 2 1
      .eslintrc.js
  2. 0 1
      client/src/includes/dialog.js
  3. 0 1
      client/storybook/preview.js

+ 2 - 1
.eslintrc.js

@@ -11,7 +11,6 @@ const legacyCode = {
   'import/no-unresolved': ['error', { ignore: ['jquery'] }],
   'import/no-useless-path-segments': 'off',
   'import/order': 'off',
-  'import/prefer-default-export': 'off',
   'jsx-a11y/alt-text': 'off',
   'jsx-a11y/anchor-is-valid': 'off',
   'jsx-a11y/click-events-have-key-events': 'off',
@@ -79,6 +78,8 @@ module.exports = {
         },
       },
     ],
+    // does not align with the majority of legacy and newer code, some use named others use default exports
+    'import/prefer-default-export': 'off',
     // note you must disable the base rule as it can report incorrect errors
     'no-use-before-define': 'off',
     'react/jsx-filename-extension': ['error', { extensions: ['.js', '.tsx'] }],

+ 0 - 1
client/src/includes/dialog.js

@@ -1,6 +1,5 @@
 import A11yDialog from 'a11y-dialog';
 
-// eslint-disable-next-line import/prefer-default-export
 export const dialog = (
   dialogs = document.querySelectorAll('[data-dialog]'),
 ) => {

+ 0 - 1
client/storybook/preview.js

@@ -3,7 +3,6 @@ import '../tests/stubs';
 import '../../wagtail/admin/static_src/wagtailadmin/scss/core.scss';
 import './preview.scss';
 
-// eslint-disable-next-line import/prefer-default-export
 export const parameters = {
   controls: {
     hideNoControlsWarning: true,