Skip to content

Commit

Permalink
Switch test/utils/*.js to ES Module (#1124)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker authored Feb 22, 2021
1 parent 67df028 commit 8161b06
Show file tree
Hide file tree
Showing 81 changed files with 160 additions and 161 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ package-lock.json
/test/integration/fixtures
.cache-eslint-remote-tester
eslint-remote-tester-results
*.log
4 changes: 2 additions & 2 deletions scripts/template/test.mjs.jst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
2 changes: 1 addition & 1 deletion test/better-regex.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {getTester} from './utils/test.js';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/catch-error-name.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/consistent-destructuring.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/consistent-function-scoping.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/custom-error-definition.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {createRequire} from 'module';
import test from 'ava';
import avaRuleTester from 'eslint-ava-rule-tester';
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test: runTest, rule} = getTester(import.meta);
const require = createRequire(import.meta.url);
Expand Down
4 changes: 2 additions & 2 deletions test/empty-brace-spaces.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {outdent} from 'outdent';
import outdent from 'outdent';
import {flatten} from 'lodash-es';
import {getTester} from './utils/test.js';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/error-message.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
2 changes: 1 addition & 1 deletion test/escape-case.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-template-curly-in-string, unicorn/escape-case */
import {getTester} from './utils/test.js';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
2 changes: 1 addition & 1 deletion test/expiring-todo-comments.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {getTester} from './utils/test.js';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/explicit-length-check.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
2 changes: 1 addition & 1 deletion test/filename-case.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {flatten} from 'lodash-es';
import {getTester} from './utils/test.js';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
2 changes: 1 addition & 1 deletion test/import-index.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {getTester} from './utils/test.js';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/import-style.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
2 changes: 1 addition & 1 deletion test/new-for-builtins.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import {getTester} from './utils/test.js';
import {getTester} from './utils/test.mjs';
import {enforceNew, disallowNew} from '../rules/utils/builtins.js';

const {test} = getTester(import.meta);
Expand Down
4 changes: 2 additions & 2 deletions test/no-abusive-eslint-disable.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import test from 'ava';
import avaRuleTester from 'eslint-ava-rule-tester';
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test: runTest, rule} = getTester(import.meta);

Expand Down
6 changes: 3 additions & 3 deletions test/no-array-callback-reference.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import test from 'ava';
import avaRuleTester from 'eslint-ava-rule-tester';
import {outdent} from 'outdent';
import notFunctionTypes from './utils/not-function-types.js';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import notFunctionTypes from './utils/not-function-types.mjs';
import {getTester} from './utils/test.mjs';

const {rule} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/no-array-for-each.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/no-array-push-push.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/no-array-reduce.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import test from 'ava';
import avaRuleTester from 'eslint-ava-rule-tester';
import {flatten} from 'lodash-es';
import {outdent} from 'outdent';
import outdent from 'outdent';
import rule from '../rules/no-array-reduce.js';
import notFunctionTypes from './utils/not-function-types.js';
import notFunctionTypes from './utils/not-function-types.mjs';

const MESSAGE_ID_REDUCE = 'reduce';
const MESSAGE_ID_REDUCE_RIGHT = 'reduceRight';
Expand Down
4 changes: 2 additions & 2 deletions test/no-console-spaces.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/no-for-loop.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import test from 'ava';
import avaRuleTester from 'eslint-ava-rule-tester';
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test: runTest, rule} = getTester(import.meta);

Expand Down
2 changes: 1 addition & 1 deletion test/no-hex-escape.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {createRequire} from 'module';
import test from 'ava';
import avaRuleTester from 'eslint-ava-rule-tester';
import {getTester} from './utils/test.js';
import {getTester} from './utils/test.mjs';

const {test: runTest, rule} = getTester(import.meta);
const require = createRequire(import.meta.url);
Expand Down
4 changes: 2 additions & 2 deletions test/no-instanceof-array.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/no-keyword-prefix.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/no-lonely-if.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/no-nested-ternary.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/no-new-array.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/no-new-buffer.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/no-null.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/no-object-as-default-parameter.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/no-process-exit.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/no-static-only-class.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/no-this-assignment.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
2 changes: 1 addition & 1 deletion test/no-unreadable-array-destructuring.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {getTester} from './utils/test.js';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
2 changes: 1 addition & 1 deletion test/no-unsafe-regex.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {getTester} from './utils/test.js';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/no-unused-properties.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/no-useless-undefined.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
2 changes: 1 addition & 1 deletion test/no-zero-fractions.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {getTester} from './utils/test.js';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/number-literal-case.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {createRequire} from 'module';
import test from 'ava';
import avaRuleTester from 'eslint-ava-rule-tester';
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test: runTest, rule} = getTester(import.meta);
const require = createRequire(import.meta.url);
Expand Down
4 changes: 2 additions & 2 deletions test/numeric-separators-style.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/prefer-add-event-listener.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/prefer-array-find.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import test from 'ava';
import {outdent} from 'outdent';
import outdent from 'outdent';
import avaRuleTester from 'eslint-ava-rule-tester';
import {getTester} from './utils/test.js';
import {getTester} from './utils/test.mjs';

const {rule} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/prefer-array-flat-map.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/prefer-array-index-of.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {getTester} from './utils/test.js';
import tests from './shared/simple-array-search-rule-tests.js';
import {getTester} from './utils/test.mjs';
import tests from './shared/simple-array-search-rule-tests.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/prefer-array-some.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
2 changes: 1 addition & 1 deletion test/prefer-date-now.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {getTester} from './utils/test.js';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
4 changes: 2 additions & 2 deletions test/prefer-default-parameters.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {outdent} from 'outdent';
import {getTester} from './utils/test.js';
import outdent from 'outdent';
import {getTester} from './utils/test.mjs';

const {test} = getTester(import.meta);

Expand Down
Loading

0 comments on commit 8161b06

Please sign in to comment.