Skip to content

Commit 501e1a1

Browse files
authored
chore(eslint)!: update eslint + ts-lint pkgs
Upgrades eslint + ts-eslint packages and configures the new change to the `@typescript-eslint/no-misused-promises` rule.
1 parent 0a16dca commit 501e1a1

File tree

4 files changed

+162
-82
lines changed

4 files changed

+162
-82
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@
6969
"@types/react": "^16.9",
7070
"@types/react-dom": "^16.9",
7171
"@types/stylis": "^4.0.0",
72-
"@typescript-eslint/eslint-plugin": "^5.3.1",
73-
"@typescript-eslint/parser": "^5.3.1",
72+
"@typescript-eslint/eslint-plugin": "^5.15.0",
73+
"@typescript-eslint/parser": "^5.15.0",
7474
"babel-jest": "26.6.3",
7575
"babel-plugin-macros": "3.0.1",
7676
"babel-preset-codecademy": "2.3.0",
@@ -79,7 +79,7 @@
7979
"enzyme": "3.11.0",
8080
"enzyme-adapter-react-16": "1.15.5",
8181
"enzyme-to-json": "3.3.5",
82-
"eslint": "^8.2.0",
82+
"eslint": "^8.11.0",
8383
"eslint-plugin-import": "^2.25.2",
8484
"eslint-plugin-jest": "^25.2.4",
8585
"eslint-plugin-jest-react": "^0.1.0",

packages/eslint-config/index.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,21 @@ module.exports = {
5454
'@typescript-eslint/unbound-method': 'off',
5555
},
5656
},
57+
// These rules need type information so can only be run on .ts* files. These will be enabled in follow-up ticket WEB-1937
58+
{
59+
files: ['*.ts', '*.tsx'],
60+
rules: {
61+
'@typescript-eslint/no-misused-promises': [
62+
'error',
63+
{
64+
checksVoidReturn: {
65+
attributes: false,
66+
properties: false,
67+
},
68+
},
69+
],
70+
},
71+
},
5772
],
5873

5974
plugins: [
@@ -102,6 +117,7 @@ module.exports = {
102117
'@typescript-eslint/no-magic-numbers': 'off',
103118
'@typescript-eslint/no-type-alias': 'off',
104119
'@typescript-eslint/typedef': 'off',
120+
105121
'arrow-body-style': 'off',
106122
camelcase: 'off',
107123
'class-methods-use-this': 'off',

packages/eslint-config/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
},
2121
"homepage": "https://github.com/Codecademy/client-modules/client-modules/packages/eslint-config",
2222
"peerDependencies": {
23-
"eslint": "^7.32.0"
23+
"eslint": "^8.11.0"
2424
},
2525
"dependencies": {
26-
"@typescript-eslint/eslint-plugin": "^5.3.1",
27-
"@typescript-eslint/parser": "^5.3.1",
26+
"@typescript-eslint/eslint-plugin": "^5.15.0",
27+
"@typescript-eslint/parser": "^5.15.0",
2828
"eslint-config-airbnb": "^18.2.1",
2929
"eslint-config-prettier": "^8.3.0",
3030
"eslint-mdx": "^1.15.0",
@@ -40,7 +40,7 @@
4040
"yargs": "^17.1.1"
4141
},
4242
"devDependencies": {
43-
"eslint": "^7.32.0"
43+
"eslint": "^8.11.0"
4444
},
4545
"publishConfig": {
4646
"access": "public"

0 commit comments

Comments
 (0)