Skip to content

Commit b5561e4

Browse files
Target ESLint 9 (#357)
Co-authored-by: Sindre Sorhus <[email protected]>
1 parent 990f069 commit b5561e4

33 files changed

+111
-98
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
node-version: [^14.17, ^16.4]
16+
node-version: [^18.18]
1717
steps:
1818
- uses: actions/checkout@v3
1919
- uses: actions/setup-node@v3

docs/rules/assertion-arguments.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Enforce passing correct arguments to assertions (`ava/assertion-arguments`)
22

3-
💼 This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
💼 This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

55
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
66

docs/rules/hooks-order.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Enforce test hook ordering (`ava/hooks-order`)
22

3-
💼 This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
💼 This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

55
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
66

docs/rules/max-asserts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Enforce a limit on the number of assertions in a test (`ava/max-asserts`)
22

3-
🚫 This rule is _disabled_ in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
🚫 This rule is _disabled_ in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

55
<!-- end auto-generated rule header -->
66

docs/rules/no-async-fn-without-await.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ensure that async tests use `await` (`ava/no-async-fn-without-await`)
22

3-
💼 This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
💼 This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

55
<!-- end auto-generated rule header -->
66

docs/rules/no-duplicate-modifiers.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ensure tests do not have duplicate modifiers (`ava/no-duplicate-modifiers`)
22

3-
💼 This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
💼 This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

55
<!-- end auto-generated rule header -->
66

docs/rules/no-identical-title.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ensure no tests have the same title (`ava/no-identical-title`)
22

3-
💼 This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
💼 This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

55
<!-- end auto-generated rule header -->
66

docs/rules/no-ignored-test-files.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ensure no tests are written in ignored files (`ava/no-ignored-test-files`)
22

3-
💼 This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
💼 This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

55
<!-- end auto-generated rule header -->
66

docs/rules/no-import-test-files.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ensure no test files are imported anywhere (`ava/no-import-test-files`)
22

3-
💼 This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
💼 This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

55
<!-- end auto-generated rule header -->
66

docs/rules/no-incorrect-deep-equal.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Disallow using `deepEqual` with primitives (`ava/no-incorrect-deep-equal`)
22

3-
💼 This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
💼 This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

55
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
66

docs/rules/no-inline-assertions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ensure assertions are not called from inline arrow functions (`ava/no-inline-assertions`)
22

3-
💼 This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
💼 This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

55
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
66

docs/rules/no-nested-tests.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ensure no tests are nested (`ava/no-nested-tests`)
22

3-
💼 This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
💼 This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

55
<!-- end auto-generated rule header -->
66

docs/rules/no-only-test.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Ensure no `test.only()` are present (`ava/no-only-test`)
22

3-
💼 This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
💼 This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

5-
🔧💡 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).
5+
🔧💡 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).
66

77
<!-- end auto-generated rule header -->
88

docs/rules/no-skip-assert.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ensure no assertions are skipped (`ava/no-skip-assert`)
22

3-
💼 This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
💼 This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

55
<!-- end auto-generated rule header -->
66

docs/rules/no-skip-test.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Ensure no tests are skipped (`ava/no-skip-test`)
22

3-
💼 This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
💼 This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

5-
🔧💡 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).
5+
🔧💡 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).
66

77
<!-- end auto-generated rule header -->
88

docs/rules/no-todo-implementation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ensure `test.todo()` is not given an implementation function (`ava/no-todo-implementation`)
22

3-
💼 This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
💼 This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

55
<!-- end auto-generated rule header -->
66

docs/rules/no-todo-test.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ensure no `test.todo()` is used (`ava/no-todo-test`)
22

3-
⚠️ This rule _warns_ in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
⚠️ This rule _warns_ in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

55
<!-- end auto-generated rule header -->
66

docs/rules/no-unknown-modifiers.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Disallow the use of unknown test modifiers (`ava/no-unknown-modifiers`)
22

3-
💼 This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
💼 This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

55
<!-- end auto-generated rule header -->
66

docs/rules/prefer-async-await.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Prefer using async/await instead of returning a Promise (`ava/prefer-async-await`)
22

3-
💼 This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
💼 This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

55
<!-- end auto-generated rule header -->
66

docs/rules/prefer-power-assert.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Enforce the use of the asserts that have no [power-assert](https://github.com/power-assert-js/power-assert) alternative (`ava/prefer-power-assert`)
22

3-
🚫 This rule is _disabled_ in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
🚫 This rule is _disabled_ in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

55
<!-- end auto-generated rule header -->
66

docs/rules/prefer-t-regex.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Prefer using `t.regex()` to test regular expressions (`ava/prefer-t-regex`)
22

3-
💼 This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
💼 This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

55
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
66

docs/rules/test-title-format.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ensure test titles have a certain format (`ava/test-title-format`)
22

3-
🚫 This rule is _disabled_ in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
🚫 This rule is _disabled_ in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

55
<!-- end auto-generated rule header -->
66

docs/rules/test-title.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ensure tests have a title (`ava/test-title`)
22

3-
💼 This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
💼 This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

55
<!-- end auto-generated rule header -->
66

docs/rules/use-t-throws-async-well.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ensure that `t.throwsAsync()` and `t.notThrowsAsync()` are awaited (`ava/use-t-throws-async-well`)
22

3-
💼 This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
💼 This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

55
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
66

docs/rules/use-t-well.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Disallow the incorrect use of `t` (`ava/use-t-well`)
22

3-
💼 This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
💼 This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

55
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
66

docs/rules/use-t.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ensure test functions use `t` as their parameter (`ava/use-t`)
22

3-
💼 This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
💼 This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

55
<!-- end auto-generated rule header -->
66

docs/rules/use-test.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ensure that AVA is imported with `test` as the variable name (`ava/use-test`)
22

3-
💼 This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
💼 This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

55
<!-- end auto-generated rule header -->
66

docs/rules/use-true-false.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ensure that `t.true()`/`t.false()` are used instead of `t.truthy()`/`t.falsy()` (`ava/use-true-false`)
22

3-
💼 This rule is enabled in the `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config).
3+
💼 This rule is enabled in the following [configs](https://github.com/avajs/eslint-plugin-ava#recommended-config): `flat/recommended`, ✅ `recommended`.
44

55
<!-- end auto-generated rule header -->
66

index.js

+42-30
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,39 @@
33
const path = require('path');
44
const importModules = require('import-modules');
55

6+
const rules = {
7+
'ava/assertion-arguments': 'error',
8+
'ava/hooks-order': 'error',
9+
'ava/max-asserts': [
10+
'off',
11+
5,
12+
],
13+
'ava/no-async-fn-without-await': 'error',
14+
'ava/no-duplicate-modifiers': 'error',
15+
'ava/no-identical-title': 'error',
16+
'ava/no-ignored-test-files': 'error',
17+
'ava/no-import-test-files': 'error',
18+
'ava/no-incorrect-deep-equal': 'error',
19+
'ava/no-inline-assertions': 'error',
20+
'ava/no-nested-tests': 'error',
21+
'ava/no-only-test': 'error',
22+
'ava/no-skip-assert': 'error',
23+
'ava/no-skip-test': 'error',
24+
'ava/no-todo-implementation': 'error',
25+
'ava/no-todo-test': 'warn',
26+
'ava/no-unknown-modifiers': 'error',
27+
'ava/prefer-async-await': 'error',
28+
'ava/prefer-power-assert': 'off',
29+
'ava/prefer-t-regex': 'error',
30+
'ava/test-title': 'error',
31+
'ava/test-title-format': 'off',
32+
'ava/use-t-well': 'error',
33+
'ava/use-t': 'error',
34+
'ava/use-t-throws-async-well': 'error',
35+
'ava/use-test': 'error',
36+
'ava/use-true-false': 'error',
37+
};
38+
639
module.exports = {
740
rules: importModules(path.resolve(__dirname, 'rules'), {camelize: false}),
841
configs: {
@@ -18,37 +51,16 @@ module.exports = {
1851
'ava',
1952
],
2053
rules: {
21-
'ava/assertion-arguments': 'error',
22-
'ava/hooks-order': 'error',
23-
'ava/max-asserts': [
24-
'off',
25-
5,
26-
],
27-
'ava/no-async-fn-without-await': 'error',
28-
'ava/no-duplicate-modifiers': 'error',
29-
'ava/no-identical-title': 'error',
30-
'ava/no-ignored-test-files': 'error',
31-
'ava/no-import-test-files': 'error',
32-
'ava/no-incorrect-deep-equal': 'error',
33-
'ava/no-inline-assertions': 'error',
34-
'ava/no-nested-tests': 'error',
35-
'ava/no-only-test': 'error',
36-
'ava/no-skip-assert': 'error',
37-
'ava/no-skip-test': 'error',
38-
'ava/no-todo-implementation': 'error',
39-
'ava/no-todo-test': 'warn',
40-
'ava/no-unknown-modifiers': 'error',
41-
'ava/prefer-async-await': 'error',
42-
'ava/prefer-power-assert': 'off',
43-
'ava/prefer-t-regex': 'error',
44-
'ava/test-title': 'error',
45-
'ava/test-title-format': 'off',
46-
'ava/use-t-well': 'error',
47-
'ava/use-t': 'error',
48-
'ava/use-t-throws-async-well': 'error',
49-
'ava/use-test': 'error',
50-
'ava/use-true-false': 'error',
54+
...rules,
5155
},
5256
},
57+
"flat/recommended": {
58+
plugins: {
59+
'ava': 'ava'
60+
},
61+
rules: {
62+
...rules
63+
}
64+
}
5365
},
5466
};

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "MIT",
66
"repository": "avajs/eslint-plugin-ava",
77
"engines": {
8-
"node": ">=14.17 <15 || >=16.4"
8+
"node": "^18.18 || >=20"
99
},
1010
"scripts": {
1111
"integration": "node ./test/integration/test.js",
@@ -63,7 +63,7 @@
6363
"xo": "^0.52.4"
6464
},
6565
"peerDependencies": {
66-
"eslint": ">=8.26.0"
66+
"eslint": ">=9"
6767
},
6868
"ava": {
6969
"files": [

0 commit comments

Comments
 (0)