Skip to content

Commit e8e4d62

Browse files
committed
fix: failing tests
1 parent 67170a4 commit e8e4d62

File tree

10 files changed

+8041
-4323
lines changed

10 files changed

+8041
-4323
lines changed

package-lock.json

Lines changed: 4845 additions & 1838 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 65 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
"name": "eslint-plugin-compat",
33
"version": "4.1.4",
44
"description": "Lint browser compatibility of API used",
5-
"main": "lib/index.js",
6-
"repository": {
7-
"type": "git",
8-
"url": "git+https://github.com/amilajack/eslint-plugin-compat.git"
9-
},
105
"keywords": [
116
"eslint",
127
"browser",
@@ -16,19 +11,24 @@
1611
"caniuse",
1712
"kangax"
1813
],
14+
"homepage": "https://github.com/amilajack/eslint-plugin-compat#readme",
15+
"bugs": {
16+
"url": "https://github.com/amilajack/eslint-plugin-compat/issues"
17+
},
18+
"repository": {
19+
"type": "git",
20+
"url": "git+https://github.com/amilajack/eslint-plugin-compat.git"
21+
},
22+
"license": "MIT",
1923
"author": "Amila Welihinda",
2024
"contributors": [
2125
"Amila Welihinda <amilajack@gmail.com> (https://github.com/amilajack)",
2226
"John Tran <jptran318@gmail.com> (https://github.com/jooohhn)"
2327
],
24-
"license": "MIT",
25-
"bugs": {
26-
"url": "https://github.com/amilajack/eslint-plugin-compat/issues"
27-
},
28+
"main": "lib/index.js",
2829
"files": [
2930
"lib"
3031
],
31-
"homepage": "https://github.com/amilajack/eslint-plugin-compat#readme",
3232
"scripts": {
3333
"benchmarks": "ts-node-transpile-only test/benchmarks.ts",
3434
"build": "rm -rf lib && tsc --project tsconfig.build.json",
@@ -39,57 +39,79 @@
3939
"tsc": "tsc",
4040
"version": "npm run build"
4141
},
42+
"prettier": {
43+
"semi": true,
44+
"tabWidth": 2,
45+
"trailingComma": "es5"
46+
},
47+
"eslintConfig": {
48+
"env": {
49+
"jest": true,
50+
"node": true
51+
},
52+
"parser": "@typescript-eslint/parser",
53+
"parserOptions": {
54+
"project": "./tsconfig.json"
55+
},
56+
"extends": [
57+
"airbnb-typescript/base",
58+
"plugin:eslint-plugin/recommended",
59+
"plugin:import/typescript",
60+
"plugin:prettier/recommended"
61+
],
62+
"rules": {
63+
"import/extensions": "off",
64+
"import/no-extraneous-dependencies": "off"
65+
},
66+
"root": true
67+
},
4268
"jest": {
4369
"preset": "ts-jest",
4470
"testEnvironment": "node",
4571
"testPathIgnorePatterns": [
4672
"/benchmarks-tmp/"
4773
]
4874
},
75+
"dependencies": {
76+
"@mdn/browser-compat-data": "^5.3.13",
77+
"ast-metadata-inferer": "^0.8.0",
78+
"browserslist": "^4.21.10",
79+
"caniuse-lite": "^1.0.30001524",
80+
"find-up": "^5.0.0",
81+
"lodash.memoize": "^4.1.2",
82+
"semver": "^7.5.4"
83+
},
4984
"devDependencies": {
50-
"@semantic-release/changelog": "^6.0.2",
85+
"@semantic-release/changelog": "^6.0.3",
5186
"@semantic-release/git": "^10.0.1",
87+
"@tsconfig/node16": "^16.1.1",
5288
"@types/benchmark": "^2.1.2",
5389
"@types/browserslist": "^4.15.0",
5490
"@types/caniuse-lite": "^1.0.1",
55-
"@types/eslint": "^8.21.0",
56-
"@types/jest": "^29.4.0",
91+
"@types/eslint": "^8.44.2",
92+
"@types/jest": "^29.5.4",
5793
"@types/lodash.memoize": "^4.1.7",
5894
"@types/semver": "7.5.0",
59-
"@typescript-eslint/eslint-plugin": "^5.51.0",
60-
"@typescript-eslint/parser": "^5.51.0",
95+
"@typescript-eslint/eslint-plugin": "^6.4.1",
96+
"@typescript-eslint/parser": "^6.4.1",
97+
"babel-eslint": "^10.1.0",
6198
"benchmark": "^2.1.4",
6299
"browserslist-config-erb": "^0.0.3",
63-
"electron": "^23.x.x",
64-
"eslint": "^8.33.0",
65-
"eslint-config-airbnb-typescript": "^17.0.0",
100+
"electron": "^26.x.x",
101+
"eslint": "^8.48.0",
102+
"eslint-config-airbnb-typescript": "^17.1.0",
66103
"eslint-config-bliss-typescript": "^6.0.2",
67-
"eslint-config-prettier": "^8.6.0",
68-
"eslint-plugin-eslint-plugin": "^5.0.8",
69-
"eslint-plugin-import": "^2.27.5",
70-
"eslint-plugin-prettier": "^4.2.1",
71-
"jest": "^29.4.2",
72-
"prettier": "^2.8.4",
73-
"semantic-release": "^20.1.0",
74-
"simple-git": "^3.16.0",
75-
"ts-jest": "^29.0.5",
104+
"eslint-config-prettier": "^9.0.0",
105+
"eslint-plugin-eslint-plugin": "^5.1.1",
106+
"eslint-plugin-import": "^2.28.1",
107+
"eslint-plugin-prettier": "^5.0.0",
108+
"jest": "^29.6.4",
109+
"prettier": "^3.0.2",
110+
"semantic-release": "^21.1.1",
111+
"simple-git": "^3.19.1",
112+
"ts-jest": "^29.1.1",
76113
"ts-node": "^10.9.1",
77-
"typescript": "^4.9.5"
78-
},
79-
"prettier": {
80-
"trailingComma": "es5",
81-
"tabWidth": 2,
82-
"semi": true
83-
},
84-
"dependencies": {
85-
"@mdn/browser-compat-data": "^5.2.47",
86-
"@tsconfig/node14": "^1.0.3",
87-
"ast-metadata-inferer": "^0.8.0",
88-
"browserslist": "^4.21.5",
89-
"caniuse-lite": "^1.0.30001473",
90-
"find-up": "^5.0.0",
91-
"lodash.memoize": "^4.1.2",
92-
"semver": "^7.5.4"
114+
"typescript": "^5.2.2"
93115
},
94116
"peerDependencies": {
95117
"eslint": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
@@ -101,26 +123,5 @@
101123
"type": "opencollective",
102124
"url": "https://opencollective.com/eslint-plugin-compat",
103125
"logo": "https://opencollective.com/opencollective/logo.txt"
104-
},
105-
"eslintConfig": {
106-
"env": {
107-
"node": true,
108-
"jest": true
109-
},
110-
"root": true,
111-
"parser": "@typescript-eslint/parser",
112-
"extends": [
113-
"airbnb-typescript/base",
114-
"plugin:eslint-plugin/recommended",
115-
"plugin:import/typescript",
116-
"plugin:prettier/recommended"
117-
],
118-
"parserOptions": {
119-
"project": "./tsconfig.json"
120-
},
121-
"rules": {
122-
"import/no-extraneous-dependencies": "off",
123-
"import/extensions": "off"
124-
}
125126
}
126127
}

src/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ export function parseBrowsersListVersion(
238238
.map((e: string): Target => {
239239
const [target, version] = e.split(" ") as [
240240
keyof TargetNameMappings,
241-
number | string
241+
number | string,
242242
];
243243

244244
const parsedVersion: number = (() => {

src/providers/mdn-provider.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { ApiMetadata } from "ast-metadata-inferer/lib/types";
44
import { reverseTargetMappings } from "../helpers";
55
import { STANDARD_TARGET_NAME_MAPPING } from "../constants";
66
import { AstMetadataApiWithTargetsResolver, Target } from "../types";
7-
import { BrowserName } from "@mdn/browser-compat-data";
87

98
const apis = apiMetadata as ApiMetadata[];
109

@@ -75,7 +74,7 @@ export function isSupportedByMDN(
7574
{ version, target: mdnTarget }: Target
7675
): boolean {
7776
// @ts-ignore
78-
const target: BrowserName = reversedTargetMappings[mdnTarget];
77+
const target = reversedTargetMappings[mdnTarget];
7978
// If no record could be found, return true. Rules might not
8079
// be found because they could belong to another provider
8180
if (!mdnRecords.has(node.protoChainId)) return true;

0 commit comments

Comments
 (0)