Browse Source

eslint - move import/first & fix

- import/first is useful in tests when we need to set up globals before importing (jquery)
LB Johnston 2 years ago
parent
commit
6995ba4aee
2 changed files with 3 additions and 3 deletions
  1. 1 1
      .eslintrc.js
  2. 2 2
      client/src/utils/cleanForSlug.test.js

+ 1 - 1
.eslintrc.js

@@ -4,7 +4,6 @@ const legacyCode = {
   'class-methods-use-this': 'off',
   'constructor-super': 'off',
   'default-param-last': 'off',
-  'import/first': 'off',
   'import/no-cycle': 'off',
   'import/no-extraneous-dependencies': 'off',
   'jsx-a11y/alt-text': 'off',
@@ -119,6 +118,7 @@ module.exports = {
       rules: {
         '@typescript-eslint/no-empty-function': 'off',
         '@typescript-eslint/no-var-requires': 'off',
+        'import/first': 'off',
         'import/no-extraneous-dependencies': 'off',
         'react/function-component-definition': 'off',
         'react/jsx-props-no-spreading': 'off',

+ 2 - 2
client/src/utils/cleanForSlug.test.js

@@ -1,9 +1,9 @@
+import { cleanForSlug } from './cleanForSlug';
+
 // eslint-disable-next-line no-unused-expressions
 require('../../../wagtail/admin/static_src/wagtailadmin/js/vendor/urlify')
   .default;
 
-import { cleanForSlug } from './cleanForSlug';
-
 describe('page-editor tests', () => {
   describe('cleanForSlug without unicode slugs enabled', () => {
     beforeEach(() => {