Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce strict mode #341

Merged
merged 2 commits into from
Nov 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions create-ava-rule.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {isDeepStrictEqual} = require('util');
const espurify = require('espurify');
const enhance = require('enhance-visitors');
Expand Down
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const path = require('path');
const importModules = require('import-modules');

Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
"plugins": [
"eslint-plugin"
],
"parserOptions": {
"sourceType": "script"
},
"extends": [
"plugin:eslint-plugin/all"
],
Expand All @@ -79,10 +82,12 @@
}
],
"rules": {
"strict": "error",
"ava/no-ignored-test-files": "off",
"eslint-plugin/prefer-message-ids": "off",
"eslint-plugin/require-meta-docs-description": "off",
"eslint-plugin/require-meta-has-suggestions": "off",
"eslint-plugin/prefer-placeholders": "off",
"import/extensions": "off",
"unicorn/prefer-module": "off"
}
Expand Down
2 changes: 2 additions & 0 deletions rules/assertion-arguments.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {visitIf} = require('enhance-visitors');
const {getStaticValue, isOpeningParenToken, isCommaToken, findVariable} = require('eslint-utils');
const util = require('../util');
Expand Down
2 changes: 2 additions & 0 deletions rules/hooks-order.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {visitIf} = require('enhance-visitors');
const createAvaRule = require('../create-ava-rule');
const util = require('../util');
Expand Down
2 changes: 2 additions & 0 deletions rules/max-asserts.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {visitIf} = require('enhance-visitors');
const util = require('../util');
const createAvaRule = require('../create-ava-rule');
Expand Down
2 changes: 2 additions & 0 deletions rules/no-async-fn-without-await.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {visitIf} = require('enhance-visitors');
const createAvaRule = require('../create-ava-rule');
const util = require('../util');
Expand Down
2 changes: 2 additions & 0 deletions rules/no-duplicate-modifiers.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {visitIf} = require('enhance-visitors');
const util = require('../util');
const createAvaRule = require('../create-ava-rule');
Expand Down
2 changes: 2 additions & 0 deletions rules/no-identical-title.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {isDeepStrictEqual} = require('util');
const espurify = require('espurify');
const {visitIf} = require('enhance-visitors');
Expand Down
2 changes: 2 additions & 0 deletions rules/no-ignored-test-files.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {visitIf} = require('enhance-visitors');
const util = require('../util');
const createAvaRule = require('../create-ava-rule');
Expand Down
2 changes: 2 additions & 0 deletions rules/no-import-test-files.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const path = require('path');
const util = require('../util');

Expand Down
2 changes: 2 additions & 0 deletions rules/no-incorrect-deep-equal.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {visitIf} = require('enhance-visitors');
const util = require('../util');
const createAvaRule = require('../create-ava-rule');
Expand Down
2 changes: 2 additions & 0 deletions rules/no-inline-assertions.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {visitIf} = require('enhance-visitors');
const createAvaRule = require('../create-ava-rule');
const util = require('../util');
Expand Down
2 changes: 2 additions & 0 deletions rules/no-nested-tests.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {visitIf} = require('enhance-visitors');
const createAvaRule = require('../create-ava-rule');
const util = require('../util');
Expand Down
2 changes: 2 additions & 0 deletions rules/no-only-test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {visitIf} = require('enhance-visitors');
const createAvaRule = require('../create-ava-rule');
const util = require('../util');
Expand Down
2 changes: 2 additions & 0 deletions rules/no-skip-assert.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {visitIf} = require('enhance-visitors');
const util = require('../util');
const createAvaRule = require('../create-ava-rule');
Expand Down
2 changes: 2 additions & 0 deletions rules/no-skip-test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {visitIf} = require('enhance-visitors');
const createAvaRule = require('../create-ava-rule');
const util = require('../util');
Expand Down
2 changes: 2 additions & 0 deletions rules/no-todo-implementation.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {visitIf} = require('enhance-visitors');
const util = require('../util');
const createAvaRule = require('../create-ava-rule');
Expand Down
2 changes: 2 additions & 0 deletions rules/no-todo-test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {visitIf} = require('enhance-visitors');
const createAvaRule = require('../create-ava-rule');
const util = require('../util');
Expand Down
2 changes: 2 additions & 0 deletions rules/no-unknown-modifiers.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {visitIf} = require('enhance-visitors');
const util = require('../util');
const createAvaRule = require('../create-ava-rule');
Expand Down
2 changes: 2 additions & 0 deletions rules/prefer-async-await.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {visitIf} = require('enhance-visitors');
const createAvaRule = require('../create-ava-rule');
const util = require('../util');
Expand Down
2 changes: 2 additions & 0 deletions rules/prefer-power-assert.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {isDeepStrictEqual} = require('util');
const espurify = require('espurify');
const {visitIf} = require('enhance-visitors');
Expand Down
2 changes: 2 additions & 0 deletions rules/prefer-t-regex.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {visitIf} = require('enhance-visitors');
const createAvaRule = require('../create-ava-rule');
const util = require('../util');
Expand Down
2 changes: 2 additions & 0 deletions rules/test-title-format.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {visitIf} = require('enhance-visitors');
const createAvaRule = require('../create-ava-rule');
const util = require('../util');
Expand Down
2 changes: 2 additions & 0 deletions rules/test-title.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {visitIf} = require('enhance-visitors');
const createAvaRule = require('../create-ava-rule');
const util = require('../util');
Expand Down
2 changes: 2 additions & 0 deletions rules/use-t-throws-async-well.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {visitIf} = require('enhance-visitors');
const util = require('../util');
const createAvaRule = require('../create-ava-rule');
Expand Down
2 changes: 2 additions & 0 deletions rules/use-t-well.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {visitIf} = require('enhance-visitors');
const MicroSpellingCorrecter = require('micro-spelling-correcter');

Expand Down
2 changes: 2 additions & 0 deletions rules/use-t.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {visitIf} = require('enhance-visitors');
const createAvaRule = require('../create-ava-rule');
const util = require('../util');
Expand Down
2 changes: 2 additions & 0 deletions rules/use-test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const path = require('path');
const {isDeepStrictEqual} = require('util');
const espurify = require('espurify');
Expand Down
2 changes: 2 additions & 0 deletions rules/use-true-false.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {isDeepStrictEqual} = require('util');
const espree = require('espree');
const espurify = require('espurify');
Expand Down
2 changes: 2 additions & 0 deletions test/assertion-arguments.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const rule = require('../rules/assertion-arguments');
Expand Down
2 changes: 2 additions & 0 deletions test/create-ava-rule.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const createAvaRule = require('../create-ava-rule');
Expand Down
2 changes: 2 additions & 0 deletions test/hooks-order.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const {outdent} = require('outdent');
Expand Down
2 changes: 2 additions & 0 deletions test/integration/eslint-config-ava-tester/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = {
parser: '@babel/eslint-parser',
parserOptions: {
Expand Down
2 changes: 2 additions & 0 deletions test/integration/test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env node
'use strict';

const path = require('path');
const process = require('process');
const Listr = require('listr');
Expand Down
2 changes: 2 additions & 0 deletions test/max-asserts.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const rule = require('../rules/max-asserts');
Expand Down
2 changes: 2 additions & 0 deletions test/no-async-fn-without-await.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const rule = require('../rules/no-async-fn-without-await');
Expand Down
2 changes: 2 additions & 0 deletions test/no-duplicate-modifiers.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const rule = require('../rules/no-duplicate-modifiers');
Expand Down
2 changes: 2 additions & 0 deletions test/no-identical-title.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const rule = require('../rules/no-identical-title');
Expand Down
2 changes: 2 additions & 0 deletions test/no-ignored-test-files.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const path = require('path');
const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
Expand Down
2 changes: 2 additions & 0 deletions test/no-import-test-files.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const path = require('path');
const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
Expand Down
2 changes: 2 additions & 0 deletions test/no-incorrect-deep-equal.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const rule = require('../rules/no-incorrect-deep-equal');
Expand Down
2 changes: 2 additions & 0 deletions test/no-inline-assertions.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const rule = require('../rules/no-inline-assertions');
Expand Down
2 changes: 2 additions & 0 deletions test/no-nested-tests.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const rule = require('../rules/no-nested-tests');
Expand Down
2 changes: 2 additions & 0 deletions test/no-only-test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const rule = require('../rules/no-only-test');
Expand Down
2 changes: 2 additions & 0 deletions test/no-skip-assert.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const rule = require('../rules/no-skip-assert');
Expand Down
2 changes: 2 additions & 0 deletions test/no-skip-test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const rule = require('../rules/no-skip-test');
Expand Down
2 changes: 2 additions & 0 deletions test/no-todo-implementation.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const rule = require('../rules/no-todo-implementation');
Expand Down
2 changes: 2 additions & 0 deletions test/no-todo-test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const rule = require('../rules/no-todo-test');
Expand Down
2 changes: 2 additions & 0 deletions test/no-unknown-modifiers.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const rule = require('../rules/no-unknown-modifiers');
Expand Down
2 changes: 2 additions & 0 deletions test/package.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const fs = require('fs');
const path = require('path');
const test = require('ava');
Expand Down
2 changes: 2 additions & 0 deletions test/prefer-async-await.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const rule = require('../rules/prefer-async-await');
Expand Down
2 changes: 2 additions & 0 deletions test/prefer-power-assert.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const rule = require('../rules/prefer-power-assert');
Expand Down
2 changes: 2 additions & 0 deletions test/prefer-t-regex.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const rule = require('../rules/prefer-t-regex');
Expand Down
2 changes: 2 additions & 0 deletions test/test-title-format.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const rule = require('../rules/test-title-format');
Expand Down
2 changes: 2 additions & 0 deletions test/test-title.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const rule = require('../rules/test-title');
Expand Down
2 changes: 2 additions & 0 deletions test/use-t-throws-async-well.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const rule = require('../rules/use-t-throws-async-well');
Expand Down
2 changes: 2 additions & 0 deletions test/use-t-well.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const rule = require('../rules/use-t-well');
Expand Down
2 changes: 2 additions & 0 deletions test/use-t.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const rule = require('../rules/use-t');
Expand Down
2 changes: 2 additions & 0 deletions test/use-test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const rule = require('../rules/use-test');
Expand Down
2 changes: 2 additions & 0 deletions test/use-true-false.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const avaRuleTester = require('eslint-ava-rule-tester');
const rule = require('../rules/use-true-false');
Expand Down
2 changes: 2 additions & 0 deletions test/util.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const test = require('ava');
const util = require('../util');
const packageJson = require('../package');
Expand Down
2 changes: 2 additions & 0 deletions util.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const path = require('path');
const pkgDir = require('pkg-dir');
const resolveFrom = require('resolve-from');
Expand Down