Skip to content

Commit

Permalink
Eslint: upgrade to version 8.0.0
Browse files Browse the repository at this point in the history
See:

- https://eslint.org/blog/2021/10/eslint-v8.0.0-released
- https://eslint.org/docs/user-guide/migrating-to-8.0.0

Known unresolved issues (with low impact )that we decided to accept:

- mysticatea/eslint-plugin-node#301

Known issues that need to be fixed first:

- [x] wait for import-js/eslint-plugin-import#2191 to be released and merged here
- [x] wait for gajus/eslint-plugin-flowtype#496 to be released and merged here
- [x] wait for testing-library/eslint-plugin-testing-library#462 to be released and merged here
- [ ] ~wait for mysticatea/eslint-plugin-node#294 to be released and merged here~ replaced (probably temporarily) with `eslint-plugin-n` which supports Eslint 8
- [x] wait for facebook/react#22248 to be released and merged here
- [x] release minor/patch version of Adeira Eslint Config before merging this breaking change
- [x] switch `NEXT_VERSION_ERROR` to `ERROR` (#3625)
  • Loading branch information
mrtnzlml committed Dec 29, 2021
1 parent efbf278 commit 4ceefb0
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 105 deletions.
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -17,7 +17,8 @@
"@babel/eslint-parser": "^7.16.5",
"babel-jest": "^27.4.5",
"babel-loader": "^8.2.3",
"eslint": "^7.32.0",
"eslint": "^8.5.0",
"eslint-formatter-codeframe": "^7.32.1",
"flow-bin": "^0.168.0",
"glob": "^7.2.0",
"jest": "^27.4.5",
Expand Down
Expand Up @@ -7,6 +7,11 @@ class Bar {}
// Normally, Eslint would complain because of `consistent-return` error, however,
// rule `node/process-exit-as-throw` makes sure this is not the case.
// See: https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/process-exit-as-throw.md

// TODO: the following `consistent-return` error is incorrect and should be removed once the following
// issue is resolved: https://github.com/mysticatea/eslint-plugin-node/issues/301. We decided to
// accept the low risk for now to ease migration to Eslint 8.
// eslint-disable-next-line consistent-return
export function foo(a: boolean): ?Bar {
if (a) {
return new Bar();
Expand Down
4 changes: 2 additions & 2 deletions src/eslint-config-adeira/package.json
Expand Up @@ -21,7 +21,7 @@
"eslint-plugin-adeira": "^0.15.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-fb-flow": "^0.0.4",
"eslint-plugin-ft-flow": "^1.1.0",
"eslint-plugin-ft-flow": "^1.1.1-alpha-0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-jest": "^25.3.2",
"eslint-plugin-jsx-a11y": "^6.5.1",
Expand All @@ -42,6 +42,6 @@
"snapshot-diff": "^0.9.0"
},
"peerDependencies": {
"eslint": ">=7.24.0 <8.0.0"
"eslint": ">=8.0.0"
}
}
4 changes: 2 additions & 2 deletions src/eslint-fixtures-tester/package.json
Expand Up @@ -18,10 +18,10 @@
"@adeira/js": "^2.1.1",
"@babel/eslint-parser": "^7.16.5",
"@babel/runtime": "^7.16.5",
"eslint": "^7.32.0",
"eslint": "^8.5.0",
"jest-docblock": "^27.4.0"
},
"peerDependencies": {
"eslint": "^7.32.0"
"eslint": "^8.5.0"
}
}
2 changes: 1 addition & 1 deletion src/eslint-plugin-adeira/package.json
Expand Up @@ -22,7 +22,7 @@
"@adeira/eslint-fixtures-tester": "0.1.0",
"@adeira/flow-types-eslint": "0.0.0",
"@babel/eslint-parser": "^7.16.5",
"eslint": "^7.32.0"
"eslint": "^8.5.0"
},
"peerDependencies": {
"graphql": "^14.0.0 || ^15.0.0"
Expand Down
4 changes: 2 additions & 2 deletions src/eslint-plugin-sx/package.json
Expand Up @@ -26,11 +26,11 @@
"@adeira/flow-types-eslint": "0.0.0",
"@babel/code-frame": "^7.16.0",
"@babel/eslint-parser": "^7.16.5",
"eslint": "^7.32.0",
"eslint": "^8.5.0",
"react": "^17.0.2"
},
"peerDependencies": {
"@adeira/sx": "^0.28.0",
"eslint": "^7.32.0"
"eslint": "^8.5.0"
}
}
6 changes: 3 additions & 3 deletions src/signed-source/src/__tests__/SignedSource.test.js
Expand Up @@ -5,11 +5,11 @@ import os from 'os';
import SignedSource from '../SignedSource';

test('signFile', () => {
expect(SignedSource.signFile(`# ${SignedSource.getSigningToken()}\ntest 1`)).toEqual(
expect(SignedSource.signFile(`# ${SignedSource.getSigningToken()}\ntest 1`)).toBe(
`# @generated SignedSource<<d9b7b52f54978f54b84a0fd48145e470>>${os.EOL}test 1`,
);

expect(SignedSource.signFile(`# ${SignedSource.getSigningToken()}\ntest 2`)).toEqual(
expect(SignedSource.signFile(`# ${SignedSource.getSigningToken()}\ntest 2`)).toBe(
`# @generated SignedSource<<4c0c1ae4f5863c72731b2f543e830fd5>>${os.EOL}test 2`,
);

Expand All @@ -18,7 +18,7 @@ test('signFile', () => {
SignedSource.signFile(
`# @generated SignedSource<<eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee>>\nalready signed test`,
),
).toEqual(`# @generated SignedSource<<54e8ffafff15a19f858d95c9a13d5b1d>>\nalready signed test`);
).toBe(`# @generated SignedSource<<54e8ffafff15a19f858d95c9a13d5b1d>>\nalready signed test`);

expect(() =>
SignedSource.signFile(`signature missing, no sign token`),
Expand Down

0 comments on commit 4ceefb0

Please sign in to comment.