Navigation Menu

Skip to content

Commit

Permalink
feat: support ESLint v8 (#465)
Browse files Browse the repository at this point in the history
* feat: support ESLint 8.x

* feat: support ESLint 8.x

* chore: downgrade ESLint to v7 in dev deps

* ci: force deps installation for running tests

Co-authored-by: Mario Beltrán Alarcón <belco90@gmail.com>
  • Loading branch information
MichaelDeBoey and Belco90 committed Oct 17, 2021
1 parent e3ebef8 commit 5b03edb
Show file tree
Hide file tree
Showing 29 changed files with 12 additions and 37 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/pipeline.yml
Expand Up @@ -52,7 +52,7 @@ jobs:
strategy:
matrix:
node: [12.22.0, 12, 14.17.0, 14, '16.0', 16]
eslint: [7.5, 7]
eslint: [7.5, 7, 8]

steps:
- name: Cancel Previous Runs
Expand All @@ -72,7 +72,9 @@ jobs:
useLockFile: false

- name: Install ESLint v${{ matrix.eslint }}
run: npm install --no-save eslint@${{ matrix.eslint }}
# force installation for now until we get ESLint and all plugins updated
# in dev dependencies
run: npm install --no-save --force eslint@${{ matrix.eslint }}

- name: Run tests
run: npm run test:ci
Expand Down
1 change: 0 additions & 1 deletion lib/rules/await-async-query.ts
Expand Up @@ -20,7 +20,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
type: 'problem',
docs: {
description: 'Enforce promises from async queries to be handled',
category: 'Best Practices',
recommendedConfig: {
dom: 'error',
angular: 'error',
Expand Down
1 change: 0 additions & 1 deletion lib/rules/await-async-utils.ts
Expand Up @@ -19,7 +19,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
type: 'problem',
docs: {
description: 'Enforce promises from async utils to be awaited properly',
category: 'Best Practices',
recommendedConfig: {
dom: 'error',
angular: 'error',
Expand Down
1 change: 0 additions & 1 deletion lib/rules/await-fire-event.ts
Expand Up @@ -19,7 +19,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
type: 'problem',
docs: {
description: 'Enforce promises from `fireEvent` methods to be handled',
category: 'Best Practices',
recommendedConfig: {
dom: false,
angular: false,
Expand Down
1 change: 0 additions & 1 deletion lib/rules/consistent-data-testid.ts
Expand Up @@ -18,7 +18,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
type: 'suggestion',
docs: {
description: 'Ensures consistent usage of `data-testid`',
category: 'Best Practices',
recommendedConfig: {
dom: false,
angular: false,
Expand Down
1 change: 0 additions & 1 deletion lib/rules/no-await-sync-events.ts
Expand Up @@ -21,7 +21,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
type: 'problem',
docs: {
description: 'Disallow unnecessary `await` for sync events',
category: 'Best Practices',
recommendedConfig: {
dom: false,
angular: false,
Expand Down
1 change: 0 additions & 1 deletion lib/rules/no-await-sync-query.ts
Expand Up @@ -13,7 +13,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
type: 'problem',
docs: {
description: 'Disallow unnecessary `await` for sync queries',
category: 'Best Practices',
recommendedConfig: {
dom: 'error',
angular: 'error',
Expand Down
1 change: 0 additions & 1 deletion lib/rules/no-container.ts
Expand Up @@ -20,7 +20,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
type: 'problem',
docs: {
description: 'Disallow the use of `container` methods',
category: 'Best Practices',
recommendedConfig: {
dom: false,
angular: 'error',
Expand Down
1 change: 0 additions & 1 deletion lib/rules/no-debugging-utils.ts
Expand Up @@ -31,7 +31,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
type: 'problem',
docs: {
description: 'Disallow the use of debugging utilities like `debug`',
category: 'Best Practices',
recommendedConfig: {
dom: false,
angular: 'error',
Expand Down
1 change: 0 additions & 1 deletion lib/rules/no-dom-import.ts
Expand Up @@ -18,7 +18,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
type: 'problem',
docs: {
description: 'Disallow importing from DOM Testing Library',
category: 'Best Practices',
recommendedConfig: {
dom: false,
angular: ['error', 'angular'],
Expand Down
1 change: 0 additions & 1 deletion lib/rules/no-manual-cleanup.ts
Expand Up @@ -29,7 +29,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
type: 'problem',
docs: {
description: 'Disallow the use of `cleanup`',
category: 'Best Practices',
recommendedConfig: {
dom: false,
angular: false,
Expand Down
1 change: 0 additions & 1 deletion lib/rules/no-node-access.ts
Expand Up @@ -13,7 +13,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
type: 'problem',
docs: {
description: 'Disallow direct Node access',
category: 'Best Practices',
recommendedConfig: {
dom: false,
angular: 'error',
Expand Down
1 change: 0 additions & 1 deletion lib/rules/no-promise-in-fire-event.ts
Expand Up @@ -20,7 +20,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
docs: {
description:
'Disallow the use of promises passed to a `fireEvent` method',
category: 'Best Practices',
recommendedConfig: {
dom: 'error',
angular: 'error',
Expand Down
1 change: 0 additions & 1 deletion lib/rules/no-render-in-setup.ts
Expand Up @@ -50,7 +50,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
docs: {
description:
'Disallow the use of `render` in testing frameworks setup functions',
category: 'Best Practices',
recommendedConfig: {
dom: false,
angular: 'error',
Expand Down
1 change: 0 additions & 1 deletion lib/rules/no-unnecessary-act.ts
Expand Up @@ -23,7 +23,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
docs: {
description:
'Disallow wrapping Testing Library utils or empty callbacks in `act`',
category: 'Possible Errors',
recommendedConfig: {
dom: false,
angular: false,
Expand Down
1 change: 0 additions & 1 deletion lib/rules/no-wait-for-empty-callback.ts
Expand Up @@ -18,7 +18,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
docs: {
description:
'Disallow empty callbacks for `waitFor` and `waitForElementToBeRemoved`',
category: 'Best Practices',
recommendedConfig: {
dom: 'error',
angular: 'error',
Expand Down
1 change: 0 additions & 1 deletion lib/rules/no-wait-for-multiple-assertions.ts
Expand Up @@ -17,7 +17,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
docs: {
description:
'Disallow the use of multiple `expect` calls inside `waitFor`',
category: 'Best Practices',
recommendedConfig: {
dom: 'error',
angular: 'error',
Expand Down
1 change: 0 additions & 1 deletion lib/rules/no-wait-for-side-effects.ts
Expand Up @@ -20,7 +20,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
type: 'suggestion',
docs: {
description: 'Disallow the use of side effects in `waitFor`',
category: 'Best Practices',
recommendedConfig: {
dom: 'error',
angular: 'error',
Expand Down
1 change: 0 additions & 1 deletion lib/rules/no-wait-for-snapshot.ts
Expand Up @@ -19,7 +19,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
docs: {
description:
'Ensures no snapshot is generated inside of a `waitFor` call',
category: 'Best Practices',
recommendedConfig: {
dom: 'error',
angular: 'error',
Expand Down
1 change: 0 additions & 1 deletion lib/rules/prefer-explicit-assert.ts
Expand Up @@ -69,7 +69,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
docs: {
description:
'Suggest using explicit assertions rather than standalone queries',
category: 'Best Practices',
recommendedConfig: {
dom: false,
angular: false,
Expand Down
1 change: 0 additions & 1 deletion lib/rules/prefer-find-by.ts
Expand Up @@ -56,7 +56,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
docs: {
description:
'Suggest using `find(All)By*` query instead of `waitFor` + `get(All)By*` to wait for elements',
category: 'Best Practices',
recommendedConfig: {
dom: 'error',
angular: 'error',
Expand Down
1 change: 0 additions & 1 deletion lib/rules/prefer-presence-queries.ts
Expand Up @@ -11,7 +11,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
name: RULE_NAME,
meta: {
docs: {
category: 'Best Practices',
description:
'Ensure appropriate `get*`/`query*` queries are used with their respective matchers',
recommendedConfig: {
Expand Down
1 change: 0 additions & 1 deletion lib/rules/prefer-query-by-disappearance.ts
Expand Up @@ -23,7 +23,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
docs: {
description:
'Suggest using `queryBy*` queries when waiting for disappearance',
category: 'Possible Errors',
recommendedConfig: {
dom: 'error',
angular: 'error',
Expand Down
1 change: 0 additions & 1 deletion lib/rules/prefer-screen-queries.ts
Expand Up @@ -40,7 +40,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
type: 'suggestion',
docs: {
description: 'Suggest using `screen` while querying',
category: 'Best Practices',
recommendedConfig: {
dom: 'error',
angular: 'error',
Expand Down
1 change: 0 additions & 1 deletion lib/rules/prefer-user-event.ts
Expand Up @@ -71,7 +71,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
docs: {
description:
'Suggest using `userEvent` over `fireEvent` for simulating user interactions',
category: 'Best Practices',
recommendedConfig: {
dom: false,
angular: false,
Expand Down
1 change: 0 additions & 1 deletion lib/rules/prefer-wait-for.ts
Expand Up @@ -26,7 +26,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
type: 'suggestion',
docs: {
description: 'Use `waitFor` instead of deprecated wait methods',
category: 'Best Practices',
recommendedConfig: {
dom: false,
angular: false,
Expand Down
1 change: 0 additions & 1 deletion lib/rules/render-result-naming-convention.ts
Expand Up @@ -24,7 +24,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
type: 'suggestion',
docs: {
description: 'Enforce a valid naming for return value from `render`',
category: 'Best Practices',
recommendedConfig: {
dom: false,
angular: 'error',
Expand Down
16 changes: 8 additions & 8 deletions package.json
Expand Up @@ -42,25 +42,25 @@
"prepare": "is-ci || husky install"
},
"dependencies": {
"@typescript-eslint/experimental-utils": "^4.30.0"
"@typescript-eslint/experimental-utils": "^5.0.0"
},
"devDependencies": {
"@babel/eslint-plugin": "^7.14.5",
"@commitlint/cli": "^13.2.1",
"@commitlint/config-conventional": "^13.2.0",
"@types/jest": "^27.0.2",
"@types/node": "^16.10.6",
"@typescript-eslint/eslint-plugin": "^4.30.0",
"@typescript-eslint/parser": "^4.30.0",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"cpy-cli": "^3.1.1",
"eslint": "^7.32.0",
"eslint-config-kentcdodds": "^19.1.1",
"eslint-config-kentcdodds": "^19.2.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-jest": "^24.4.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jest": "^25.0.6",
"eslint-plugin-jest-formatting": "^3.0.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.4.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-promise": "^5.1.0",
"husky": "^7.0.2",
"is-ci": "^3.0.0",
Expand All @@ -73,7 +73,7 @@
"typescript": "^4.4.4"
},
"peerDependencies": {
"eslint": "^7.5.0"
"eslint": "^7.5.0 || ^8.0.0"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0",
Expand Down
1 change: 0 additions & 1 deletion tests/fake-rule.ts
Expand Up @@ -26,7 +26,6 @@ export default createTestingLibraryRule<Options, MessageIds>({
type: 'problem',
docs: {
description: 'Fake rule to test rule maker and detection helpers',
category: 'Possible Errors',
recommendedConfig: {
dom: false,
angular: false,
Expand Down

0 comments on commit 5b03edb

Please sign in to comment.