Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Commit dae1e44

Browse files
authored
Migrate types to @typescript-eslint (#222)
1 parent 2f383ff commit dae1e44

File tree

63 files changed

+2488
-2398
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2488
-2398
lines changed

package.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"scripts": {
2222
"build": "rimraf lib && yarn check-format && tsc -d -p tsconfig-src.json",
2323
"test": "jest",
24-
"ruling": "ts-node ruling/index.ts",
24+
"ruling": "ts-node --files ruling/index.ts",
2525
"typecheck": "tsc -p tsconfig.json",
2626
"lint": "eslint --ext js,ts src tests ruling/index.ts",
2727
"precommit": "lint-staged && yarn typecheck",
@@ -33,14 +33,12 @@
3333
"eslint": "^5.0.0 || ^6.0.0 || ^7.0.0"
3434
},
3535
"devDependencies": {
36-
"@types/eslint": "7.2.6",
37-
"@types/estree": "0.0.46",
3836
"@types/jest": "26.0.20",
3937
"@types/lodash": "4.14.106",
4038
"@types/minimist": "1.2.0",
4139
"@types/node": "14.14.25",
42-
"@typescript-eslint/experimental-utils": "4.15.0",
43-
"@typescript-eslint/parser": "4.15.0",
40+
"@typescript-eslint/experimental-utils": "4.28.0",
41+
"@typescript-eslint/parser": "4.28.0",
4442
"babel-eslint": "8.2.2",
4543
"eslint": "7.19.0",
4644
"eslint-config-prettier": "2.9.0",
@@ -56,7 +54,7 @@
5654
"rimraf": "2.6.2",
5755
"ts-jest": "26.5.1",
5856
"ts-node": "9.1.1",
59-
"typescript": "4.1.4"
57+
"typescript": "4.3.4"
6058
},
6159
"prettier": {
6260
"printWidth": 100,

ruling/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ function run() {
4949
const cli = new CLIEngine({
5050
parser: "babel-eslint",
5151
parserOptions: {
52+
// @ts-ignore 'experimentalObjectRestSpread' is missing in type definition
5253
ecmaFeatures: { jsx: true, experimentalObjectRestSpread: true },
5354
ecmaVersion: 2018,
5455
sourceType: "module",

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
* along with this program; if not, write to the Free Software Foundation,
1818
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1919
*/
20-
import { Linter } from 'eslint';
20+
import { TSESLint } from '@typescript-eslint/experimental-utils';
2121

22-
const sonarjsRules: [string, Linter.RuleLevel][] = [
22+
const sonarjsRules: [string, TSESLint.Linter.RuleLevel][] = [
2323
['cognitive-complexity', 'error'],
2424
['max-switch-cases', 'error'],
2525
['no-all-duplicated-branches', 'error'],
@@ -47,9 +47,9 @@ const sonarjsRules: [string, Linter.RuleLevel][] = [
4747
['prefer-while', 'error'],
4848
];
4949

50-
const sonarjsRuleModules: any = {};
50+
const sonarjsRuleModules: { [key: string]: any } = {};
5151

52-
const configs: { recommended: Linter.Config & { plugins: string[] } } = {
52+
const configs: { recommended: TSESLint.Linter.Config & { plugins: string[] } } = {
5353
recommended: { plugins: ['sonarjs'], rules: {} },
5454
};
5555

0 commit comments

Comments
 (0)