Skip to content

Commit

Permalink
Meta tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed May 3, 2024
1 parent b5561e4 commit b1c1a52
Show file tree
Hide file tree
Showing 49 changed files with 204 additions and 178 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
matrix:
node-version: [^18.18]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install --no-audit
Expand All @@ -27,8 +27,8 @@ jobs:
name: Integration tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm install --no-audit
- run: npm run integration
- uses: codecov/codecov-action@v3
4 changes: 2 additions & 2 deletions create-ava-rule.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const {isDeepStrictEqual} = require('util');
const {isDeepStrictEqual} = require('node:util');
const espurify = require('espurify');
const enhance = require('enhance-visitors');
const util = require('./util');
Expand Down Expand Up @@ -216,7 +216,7 @@ module.exports = () => {
};

return {
hasTestModifier: mod => getTestModifierNames(currentTestNode).includes(mod),
hasTestModifier: module_ => getTestModifierNames(currentTestNode).includes(module_),
hasNoUtilityModifier() {
const modifiers = getTestModifierNames(currentTestNode);
return !modifiers.includes('before')
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/assertion-arguments.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Enforce passing correct arguments to assertions (`ava/assertion-arguments`)

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/hooks-order.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Enforce test hook ordering (`ava/hooks-order`)

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/max-asserts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Enforce a limit on the number of assertions in a test (`ava/max-asserts`)

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-async-fn-without-await.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ensure that async tests use `await` (`ava/no-async-fn-without-await`)

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-duplicate-modifiers.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ensure tests do not have duplicate modifiers (`ava/no-duplicate-modifiers`)

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-identical-title.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ensure no tests have the same title (`ava/no-identical-title`)

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-ignored-test-files.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ensure no tests are written in ignored files (`ava/no-ignored-test-files`)

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-import-test-files.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ensure no test files are imported anywhere (`ava/no-import-test-files`)

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-incorrect-deep-equal.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Disallow using `deepEqual` with primitives (`ava/no-incorrect-deep-equal`)

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-inline-assertions.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ensure assertions are not called from inline arrow functions (`ava/no-inline-assertions`)

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-nested-tests.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ensure no tests are nested (`ava/no-nested-tests`)

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-only-test.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ensure no `test.only()` are present (`ava/no-only-test`)

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

🔧💡 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).

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-skip-assert.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ensure no assertions are skipped (`ava/no-skip-assert`)

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-skip-test.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ensure no tests are skipped (`ava/no-skip-test`)

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

🔧💡 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).

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-todo-implementation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ensure `test.todo()` is not given an implementation function (`ava/no-todo-implementation`)

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-todo-test.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ensure no `test.todo()` is used (`ava/no-todo-test`)

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-unknown-modifiers.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Disallow the use of unknown test modifiers (`ava/no-unknown-modifiers`)

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/prefer-async-await.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Prefer using async/await instead of returning a Promise (`ava/prefer-async-await`)

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/prefer-power-assert.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Enforce the use of the asserts that have no [power-assert](https://github.com/power-assert-js/power-assert) alternative (`ava/prefer-power-assert`)

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/prefer-t-regex.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Prefer using `t.regex()` to test regular expressions (`ava/prefer-t-regex`)

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/test-title-format.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ensure test titles have a certain format (`ava/test-title-format`)

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/test-title.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ensure tests have a title (`ava/test-title`)

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/use-t-throws-async-well.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ensure that `t.throwsAsync()` and `t.notThrowsAsync()` are awaited (`ava/use-t-throws-async-well`)

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/use-t-well.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Disallow the incorrect use of `t` (`ava/use-t-well`)

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/use-t.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ensure test functions use `t` as their parameter (`ava/use-t`)

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/use-test.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ensure that AVA is imported with `test` as the variable name (`ava/use-test`)

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/use-true-false.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ensure that `t.true()`/`t.false()` are used instead of `t.truthy()`/`t.falsy()` (`ava/use-true-false`)

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

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

Expand Down
12 changes: 6 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

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

const rules = {
Expand Down Expand Up @@ -54,13 +54,13 @@ module.exports = {
...rules,
},
},
"flat/recommended": {
'flat/recommended': {
plugins: {
'ava': 'ava'
ava: 'ava',
},
rules: {
...rules
}
}
...rules,
},
},
},
};
2 changes: 1 addition & 1 deletion license
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "ESLint rules for AVA",
"license": "MIT",
"repository": "avajs/eslint-plugin-ava",
"sideEffects": false,
"engines": {
"node": "^18.18 || >=20"
},
Expand All @@ -14,7 +15,7 @@
"lint:js": "xo",
"test": "npm-run-all lint test:unit",
"test:unit": "c8 ava",
"update:eslint-docs": "eslint-doc-generator --rule-doc-section-include Pass --rule-doc-section-include Fail --url-configs \"https://github.com/avajs/eslint-plugin-ava#recommended-config\""
"update:eslint-docs": "eslint-doc-generator --rule-doc-section-include Pass --rule-doc-section-include Fail --url-configs \"https://github.com/avajs/eslint-plugin-ava#recommended-config\" --ignore-config=flat/recommended"
},
"files": [
"index.js",
Expand Down Expand Up @@ -53,14 +54,14 @@
"eslint": "^8.26.0",
"eslint-ava-rule-tester": "^4.0.0",
"eslint-doc-generator": "^1.0.0",
"eslint-plugin-eslint-plugin": "^5.0.6",
"eslint-plugin-eslint-plugin": "^6.1.0",
"execa": "^5.1.1",
"listr": "^0.14.3",
"npm-run-all": "^4.1.5",
"outdent": "^0.8.0",
"pify": "^5.0.0",
"tempy": "^1.0.1",
"xo": "^0.52.4"
"xo": "^0.58.0"
},
"peerDependencies": {
"eslint": ">=9"
Expand Down Expand Up @@ -102,7 +103,9 @@
"eslint-plugin/require-meta-has-suggestions": "off",
"eslint-plugin/prefer-placeholders": "off",
"import/extensions": "off",
"unicorn/prefer-module": "off"
"unicorn/prefer-module": "off",
"unicorn/prefer-top-level-await": "off",
"eslint-plugin/require-meta-docs-recommended": "off"
}
},
"c8": {
Expand Down

0 comments on commit b1c1a52

Please sign in to comment.