Skip to content

Commit 4213cbe

Browse files
committed
Add ESLint 9 support and flat/recommended config
1 parent fb13185 commit 4213cbe

11 files changed

Lines changed: 54 additions & 34 deletions

.eslint-doc-generatorrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/** @type {import('eslint-doc-generator').GenerateOptions} */
2+
const config = {
3+
configEmoji: [['flat/recommended', '☑️']],
4+
};
5+
6+
module.exports = config;

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ npm install -D eslint-plugin-proper-tests
1313
```
1414

1515
> [!NOTE]
16-
> For `@typescript-eslint` v7 use version ^1.0.0 of this plugin. For `@typescript-eslint` v8 use version ^2.0.0 of this plugin.
16+
> For `@typescript-eslint` v7 use version ^1.0.0 of this plugin.
17+
> For `@typescript-eslint` v8 use version ^2.0.0 of this plugin.
18+
> For `@typescript-eslint` v9 use version ^2.1.0 of this plugin.
1719
1820
## Usage
1921

@@ -109,14 +111,15 @@ and you are done, no other configuration is needed.
109111
<!-- begin auto-generated rules list -->
110112

111113
💼 Configurations enabled in.\
114+
☑️ Set in the `flat/recommended` configuration.\
112115
✅ Set in the `recommended` configuration.
113116

114-
| Name                             | Description | 💼 |
115-
| :--------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------- | :- |
116-
| [no-long-arrays-in-test-each](docs/rules/no-long-arrays-in-test-each.md) | Disallow using long arrays with objects inside `test.each()` or `it.each()`. Force moving them out of the file. | |
117-
| [no-mixed-expectation-groups](docs/rules/no-mixed-expectation-groups.md) | Disallow mixing expectations for different variables between each other. | |
118-
| [no-useless-matcher-to-be-defined](docs/rules/no-useless-matcher-to-be-defined.md) | Disallow using `.toBeDefined()` matcher when it is known that variable is always defined. | |
119-
| [no-useless-matcher-to-be-null](docs/rules/no-useless-matcher-to-be-null.md) | Disallow using `.toBeNull()` when TypeScript types conflict with it. | |
117+
| Name                             | Description | 💼 |
118+
| :--------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------- | :--- |
119+
| [no-long-arrays-in-test-each](docs/rules/no-long-arrays-in-test-each.md) | Disallow using long arrays with objects inside `test.each()` or `it.each()`. Force moving them out of the file. | ☑️ ✅ |
120+
| [no-mixed-expectation-groups](docs/rules/no-mixed-expectation-groups.md) | Disallow mixing expectations for different variables between each other. | ☑️ ✅ |
121+
| [no-useless-matcher-to-be-defined](docs/rules/no-useless-matcher-to-be-defined.md) | Disallow using `.toBeDefined()` matcher when it is known that variable is always defined. | ☑️ ✅ |
122+
| [no-useless-matcher-to-be-null](docs/rules/no-useless-matcher-to-be-null.md) | Disallow using `.toBeNull()` when TypeScript types conflict with it. | ☑️ ✅ |
120123

121124
<!-- end auto-generated rules list -->
122125

docs/rules/no-long-arrays-in-test-each.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Disallow using long arrays with objects inside `test.each()` or `it.each()`. Force moving them out of the file (`proper-tests/no-long-arrays-in-test-each`)
22

3-
💼 This rule is enabled in the `recommended` config.
3+
💼 This rule is enabled in the following configs: ☑️ `flat/recommended`, ✅ `recommended`.
44

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

docs/rules/no-mixed-expectation-groups.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Disallow mixing expectations for different variables between each other (`proper-tests/no-mixed-expectation-groups`)
22

3-
💼 This rule is enabled in the `recommended` config.
3+
💼 This rule is enabled in the following configs: ☑️ `flat/recommended`, ✅ `recommended`.
44

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

docs/rules/no-useless-matcher-to-be-defined.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Disallow using `.toBeDefined()` matcher when it is known that variable is always defined (`proper-tests/no-useless-matcher-to-be-defined`)
22

3-
💼 This rule is enabled in the `recommended` config.
3+
💼 This rule is enabled in the following configs: ☑️ `flat/recommended`, ✅ `recommended`.
44

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

docs/rules/no-useless-matcher-to-be-null.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Disallow using `.toBeNull()` when TypeScript types conflict with it (`proper-tests/no-useless-matcher-to-be-null`)
22

3-
💼 This rule is enabled in the `recommended` config.
3+
💼 This rule is enabled in the following configs: ☑️ `flat/recommended`, ✅ `recommended`.
44

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

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-plugin-proper-tests",
3-
"version": "2.0.0",
3+
"version": "2.1.0",
44
"description": "ESLint rules for writing more proper tests.",
55
"keywords": [
66
"eslint",
@@ -34,7 +34,8 @@
3434
"lint:docs": "markdownlint \"**/*.md\"",
3535
"lint:eslint-docs": "npm run update:eslint-docs -- --check",
3636
"update:eslint-docs": "npm run build && eslint-doc-generator",
37-
"build": "tsc --build ./tsconfig.build.json"
37+
"build": "tsc --build ./tsconfig.build.json",
38+
"ci:build": "npm run build"
3839
},
3940
"dependencies": {
4041
"@typescript-eslint/eslint-plugin": "^8.8.1",
@@ -66,7 +67,7 @@
6667
"dist"
6768
],
6869
"peerDependencies": {
69-
"eslint": ">= 8",
70+
"eslint": "^8.0.0 || ^9.0.0",
7071
"typescript": "*"
7172
},
7273
"peerDependenciesMeta": {

src/configs/recommended.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/plugin.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ describe('proper tests plugin', (): void => {
1111
});
1212

1313
test('it exposes recommended plugin', (): void => {
14-
expect(Object.keys(plugin.configs)).toEqual(['recommended']);
14+
expect(Object.keys(plugin.configs)).toEqual(['recommended', 'flat/recommended']);
1515
});
1616
});

0 commit comments

Comments
 (0)