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
pull/8591/head
LB (Ben Johnston) 2022-06-01 07:47:50 +10:00 zatwierdzone przez GitHub
rodzic 1a49cae272
commit 9a04aefe9a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 2 dodań i 3 usunięć

Wyświetl plik

@ -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'] }],

Wyświetl plik

@ -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]'),
) => {

Wyświetl plik

@ -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,