Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for typescript eslint rules and warn on unused variables #185

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"extends": ["next/core-web-vitals"],
"extends": ["next/core-web-vitals", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"root": true,
"rules": {
"max-len": [1, 120, 2, { "ignoreComments": true }],
"curly": ["off"],
Expand All @@ -16,6 +19,8 @@
".ts": "never",
".tsx": "never"
}
]
],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "warn"
}
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@
"@types/react": "^18.0.8",
"@types/react-plotly.js": "^2.5.0",
"@types/styled-components": "^5.1.26",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"apollo": "^2.33.10",
"babel-jest": "^28.0.3",
"babel-loader": "^8.2.5",
Expand Down
8 changes: 1 addition & 7 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
import React, { useEffect } from 'react';
import App, { AppProps } from 'next/app';
import getConfig from 'next/config';
import {
gql,
ApolloProvider,
ApolloClient,
InMemoryCache,
} from '@apollo/client';
import { ApolloProvider, ApolloClient, InMemoryCache } from '@apollo/client';
import ReactPiwik from 'react-piwik';
import { ThemeProvider } from 'styled-components';
import { Router, useRouter } from 'next/router';
import numbro from 'numbro';

import StatusMessage from 'components/common/StatusMessage';
import { captureException } from 'common/sentry';
import { appWithTranslation } from 'common/i18n';
import withApollo, {
initializeApolloClient,
Expand Down
197 changes: 197 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2057,6 +2057,24 @@ __metadata:
languageName: node
linkType: hard

"@eslint-community/eslint-utils@npm:^4.4.0":
version: 4.4.0
resolution: "@eslint-community/eslint-utils@npm:4.4.0"
dependencies:
eslint-visitor-keys: ^3.3.0
peerDependencies:
eslint: ^6.0.0 || ^7.0.0 || >=8.0.0
checksum: cdfe3ae42b4f572cbfb46d20edafe6f36fc5fb52bf2d90875c58aefe226892b9677fef60820e2832caf864a326fe4fc225714c46e8389ccca04d5f9288aabd22
languageName: node
linkType: hard

"@eslint-community/regexpp@npm:^4.5.1":
version: 4.9.1
resolution: "@eslint-community/regexpp@npm:4.9.1"
checksum: 06fb839e9c756f6375cc545c2f2e05a0a64576bd6370e8e3c07983fd29a3d6e164ef4aa48a361f7d27e6713ab79c83053ff6a2ccb78748bc955e344279c4a3b6
languageName: node
linkType: hard

"@eslint/eslintrc@npm:^1.3.3":
version: 1.3.3
resolution: "@eslint/eslintrc@npm:1.3.3"
Expand Down Expand Up @@ -6068,6 +6086,13 @@ __metadata:
languageName: node
linkType: hard

"@types/json-schema@npm:^7.0.12":
version: 7.0.13
resolution: "@types/json-schema@npm:7.0.13"
checksum: 345df21a678fa72fb389f35f33de77833d09d4a142bb2bcb27c18690efa4cf70fc2876e43843cefb3fbdb9fcb12cd3e970a90936df30f53bbee899865ff605ab
languageName: node
linkType: hard

"@types/json-stable-stringify@npm:^1.0.32":
version: 1.0.34
resolution: "@types/json-stable-stringify@npm:1.0.34"
Expand Down Expand Up @@ -6277,6 +6302,13 @@ __metadata:
languageName: node
linkType: hard

"@types/semver@npm:^7.5.0":
version: 7.5.3
resolution: "@types/semver@npm:7.5.3"
checksum: 349fdd1ab6c213bac5c991bac766bd07b8b12e63762462bb058740dcd2eb09c8193d068bb226f134661275f2022976214c0e727a4e5eb83ec1b131127c980d3e
languageName: node
linkType: hard

"@types/source-list-map@npm:*":
version: 0.1.2
resolution: "@types/source-list-map@npm:0.1.2"
Expand Down Expand Up @@ -6414,6 +6446,31 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/eslint-plugin@npm:^6.7.4":
version: 6.7.4
resolution: "@typescript-eslint/eslint-plugin@npm:6.7.4"
dependencies:
"@eslint-community/regexpp": ^4.5.1
"@typescript-eslint/scope-manager": 6.7.4
"@typescript-eslint/type-utils": 6.7.4
"@typescript-eslint/utils": 6.7.4
"@typescript-eslint/visitor-keys": 6.7.4
debug: ^4.3.4
graphemer: ^1.4.0
ignore: ^5.2.4
natural-compare: ^1.4.0
semver: ^7.5.4
ts-api-utils: ^1.0.1
peerDependencies:
"@typescript-eslint/parser": ^6.0.0 || ^6.0.0-alpha
eslint: ^7.0.0 || ^8.0.0
peerDependenciesMeta:
typescript:
optional: true
checksum: 91d5051ae935d8bb61091665ee1e5c456992a0c29b58c86c1bb2b72c935dd831c0d3c7726a8d609455ae4a8b4ba8786ebeeef4bc7eff388b5f77475e7a634dc0
languageName: node
linkType: hard

"@typescript-eslint/parser@npm:^5.21.0":
version: 5.46.1
resolution: "@typescript-eslint/parser@npm:5.46.1"
Expand All @@ -6431,6 +6488,24 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/parser@npm:^6.7.4":
version: 6.7.4
resolution: "@typescript-eslint/parser@npm:6.7.4"
dependencies:
"@typescript-eslint/scope-manager": 6.7.4
"@typescript-eslint/types": 6.7.4
"@typescript-eslint/typescript-estree": 6.7.4
"@typescript-eslint/visitor-keys": 6.7.4
debug: ^4.3.4
peerDependencies:
eslint: ^7.0.0 || ^8.0.0
peerDependenciesMeta:
typescript:
optional: true
checksum: 60e7c01a69c1a67577f031cd6ef3c7980a9aedf2045b9950e339836acb2fe9d7bf0c8909fa95d713a8270f19dead43d82beb27dcf8705f81fe35b14b737e8fe0
languageName: node
linkType: hard

"@typescript-eslint/scope-manager@npm:5.46.1":
version: 5.46.1
resolution: "@typescript-eslint/scope-manager@npm:5.46.1"
Expand All @@ -6441,13 +6516,47 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/scope-manager@npm:6.7.4":
version: 6.7.4
resolution: "@typescript-eslint/scope-manager@npm:6.7.4"
dependencies:
"@typescript-eslint/types": 6.7.4
"@typescript-eslint/visitor-keys": 6.7.4
checksum: 8475d28f6408c204fb6bf25df45c1f16cad950190e31346c4b1ae15461a96f30b31b6fd1d3d635b41db6aa9a3fd3de25f04823632c74eeea478f34ebd134a1b0
languageName: node
linkType: hard

"@typescript-eslint/type-utils@npm:6.7.4":
version: 6.7.4
resolution: "@typescript-eslint/type-utils@npm:6.7.4"
dependencies:
"@typescript-eslint/typescript-estree": 6.7.4
"@typescript-eslint/utils": 6.7.4
debug: ^4.3.4
ts-api-utils: ^1.0.1
peerDependencies:
eslint: ^7.0.0 || ^8.0.0
peerDependenciesMeta:
typescript:
optional: true
checksum: 231240a1aa1008a1b1facdd40b931433606947254f6e04705d154791a8b2c15d5ce3355b7d8a29cf7bb53c2e2eca1340c7860dd395389858d442af06c586d1fd
languageName: node
linkType: hard

"@typescript-eslint/types@npm:5.46.1":
version: 5.46.1
resolution: "@typescript-eslint/types@npm:5.46.1"
checksum: 91143d3304b8c70d69d9c8e5b7428cce3a222eacfbeb99e592d278668bcf998760731deae064a76157b9a0fc4911fe3178aa24e4ea6fe2ba68dd37113834c924
languageName: node
linkType: hard

"@typescript-eslint/types@npm:6.7.4":
version: 6.7.4
resolution: "@typescript-eslint/types@npm:6.7.4"
checksum: 287ae48a2bb722b866460bcb2ba4ff908348145b3fc0af4ea75679d474e9ba3632bf64689044f181fe8ca3cb5f41238bb31ea428d5e78f1c3982f6dac6b7b149
languageName: node
linkType: hard

"@typescript-eslint/typescript-estree@npm:5.46.1":
version: 5.46.1
resolution: "@typescript-eslint/typescript-estree@npm:5.46.1"
Expand All @@ -6466,6 +6575,41 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/typescript-estree@npm:6.7.4":
version: 6.7.4
resolution: "@typescript-eslint/typescript-estree@npm:6.7.4"
dependencies:
"@typescript-eslint/types": 6.7.4
"@typescript-eslint/visitor-keys": 6.7.4
debug: ^4.3.4
globby: ^11.1.0
is-glob: ^4.0.3
semver: ^7.5.4
ts-api-utils: ^1.0.1
peerDependenciesMeta:
typescript:
optional: true
checksum: 2e8f5e972403233522eff09cfe7a0a23549cfd462e82b434aa32ddbdba5b329be5a549514a157f6b79e2d0159c9348d23b202e5d915d4f2c7cbfe72e1a48a429
languageName: node
linkType: hard

"@typescript-eslint/utils@npm:6.7.4":
version: 6.7.4
resolution: "@typescript-eslint/utils@npm:6.7.4"
dependencies:
"@eslint-community/eslint-utils": ^4.4.0
"@types/json-schema": ^7.0.12
"@types/semver": ^7.5.0
"@typescript-eslint/scope-manager": 6.7.4
"@typescript-eslint/types": 6.7.4
"@typescript-eslint/typescript-estree": 6.7.4
semver: ^7.5.4
peerDependencies:
eslint: ^7.0.0 || ^8.0.0
checksum: 75e197dd58b230436ceb51f2050bb3af8796b05a197eaf741251f8e9c4d9ba1a99d654d090da0c49d31b20da79d9cc3746cbb663ffd5ea614d7a960d64676d65
languageName: node
linkType: hard

"@typescript-eslint/visitor-keys@npm:5.46.1":
version: 5.46.1
resolution: "@typescript-eslint/visitor-keys@npm:5.46.1"
Expand All @@ -6476,6 +6620,16 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/visitor-keys@npm:6.7.4":
version: 6.7.4
resolution: "@typescript-eslint/visitor-keys@npm:6.7.4"
dependencies:
"@typescript-eslint/types": 6.7.4
eslint-visitor-keys: ^3.4.1
checksum: 34d09798b6c48dc059e88c6cb3df5f96e859bd65d1dd05d907b8a3c7a5708a737d50607081fb14a4b974b90cfe4169a93db974bf53af8b282420187f73b0afac
languageName: node
linkType: hard

"@webassemblyjs/ast@npm:1.11.1":
version: 1.11.1
resolution: "@webassemblyjs/ast@npm:1.11.1"
Expand Down Expand Up @@ -12119,6 +12273,13 @@ __metadata:
languageName: node
linkType: hard

"eslint-visitor-keys@npm:^3.4.1":
version: 3.4.3
resolution: "eslint-visitor-keys@npm:3.4.3"
checksum: 36e9ef87fca698b6fd7ca5ca35d7b2b6eeaaf106572e2f7fd31c12d3bfdaccdb587bba6d3621067e5aece31c8c3a348b93922ab8f7b2cbc6aaab5e1d89040c60
languageName: node
linkType: hard

"eslint@npm:^8.14.0":
version: 8.29.0
resolution: "eslint@npm:8.29.0"
Expand Down Expand Up @@ -14012,6 +14173,13 @@ __metadata:
languageName: node
linkType: hard

"graphemer@npm:^1.4.0":
version: 1.4.0
resolution: "graphemer@npm:1.4.0"
checksum: bab8f0be9b568857c7bec9fda95a89f87b783546d02951c40c33f84d05bb7da3fd10f863a9beb901463669b6583173a8c8cc6d6b306ea2b9b9d5d3d943c3a673
languageName: node
linkType: hard

"graphlib@npm:^2.1.8":
version: 2.1.8
resolution: "graphlib@npm:2.1.8"
Expand Down Expand Up @@ -14868,6 +15036,13 @@ __metadata:
languageName: node
linkType: hard

"ignore@npm:^5.2.4":
version: 5.2.4
resolution: "ignore@npm:5.2.4"
checksum: 3d4c309c6006e2621659311783eaea7ebcd41fe4ca1d78c91c473157ad6666a57a2df790fe0d07a12300d9aac2888204d7be8d59f9aaf665b1c7fcdb432517ef
languageName: node
linkType: hard

"image-palette@npm:^2.1.0":
version: 2.1.0
resolution: "image-palette@npm:2.1.0"
Expand Down Expand Up @@ -16925,6 +17100,8 @@ __metadata:
"@types/react": ^18.0.8
"@types/react-plotly.js": ^2.5.0
"@types/styled-components": ^5.1.26
"@typescript-eslint/eslint-plugin": ^6.7.4
"@typescript-eslint/parser": ^6.7.4
apollo: ^2.33.10
autoprefixer: ^10.4.7
babel-jest: ^28.0.3
Expand Down Expand Up @@ -22434,6 +22611,17 @@ __metadata:
languageName: node
linkType: hard

"semver@npm:^7.5.4":
version: 7.5.4
resolution: "semver@npm:7.5.4"
dependencies:
lru-cache: ^6.0.0
bin:
semver: bin/semver.js
checksum: 12d8ad952fa353b0995bf180cdac205a4068b759a140e5d3c608317098b3575ac2f1e09182206bf2eb26120e1c0ed8fb92c48c592f6099680de56bb071423ca3
languageName: node
linkType: hard

"send@npm:0.18.0":
version: 0.18.0
resolution: "send@npm:0.18.0"
Expand Down Expand Up @@ -24228,6 +24416,15 @@ __metadata:
languageName: node
linkType: hard

"ts-api-utils@npm:^1.0.1":
version: 1.0.3
resolution: "ts-api-utils@npm:1.0.3"
peerDependencies:
typescript: ">=4.2.0"
checksum: 441cc4489d65fd515ae6b0f4eb8690057add6f3b6a63a36073753547fb6ce0c9ea0e0530220a0b282b0eec535f52c4dfc315d35f8a4c9a91c0def0707a714ca6
languageName: node
linkType: hard

"ts-dedent@npm:^2.0.0":
version: 2.2.0
resolution: "ts-dedent@npm:2.2.0"
Expand Down