-
-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: bump deps * test: update snapshots * chore: babel-eslint to @babel/eslint-parser * feat: support flat config Resolves: #603 * test: add typing tests for flat configs * docs: add flat config example to README * chore: deprecate named export * feat: provide type declaration * 5.0.0-0 * fix: add esm/cjs support * 5.0.0-1 * 5.0.0-2 --------- Co-authored-by: Amila Welihinda <[email protected]>
- Loading branch information
Showing
13 changed files
with
3,317 additions
and
4,655 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "eslint-plugin-compat", | ||
"version": "4.2.0", | ||
"version": "5.0.0-2", | ||
"description": "Lint browser compatibility of API used", | ||
"keywords": [ | ||
"eslint", | ||
|
@@ -25,13 +25,26 @@ | |
"Amila Welihinda <[email protected]> (https://github.com/amilajack)", | ||
"John Tran <[email protected]> (https://github.com/jooohhn)" | ||
], | ||
"main": "lib/index.js", | ||
"main": "./lib/cjs/src/index.js", | ||
"types": "./lib/cjs/src/index.d.ts", | ||
"exports": { | ||
".": { | ||
"import": { | ||
"types": "./lib/esm//src/index.d.mts", | ||
"default": "./lib/esm/src/index.js" | ||
}, | ||
"require": { | ||
"types": "./lib/cjs/src/index.d.ts", | ||
"default": "./lib/cjs/src/index.js" | ||
} | ||
} | ||
}, | ||
"files": [ | ||
"lib" | ||
], | ||
"scripts": { | ||
"benchmarks": "ts-node-transpile-only test/benchmarks.ts", | ||
"build": "rm -rf lib && tsc --project tsconfig.build.json", | ||
"build": "rm -rf lib && tsc --project tsconfig.build.json && tsc --project tsconfig.esm.json", | ||
"lint": "eslint --ignore-path .gitignore --ext .js,.ts .", | ||
"spec": "jest --testPathIgnorePatterns test/e2e-repo.spec.ts /benchmarks-tmp", | ||
"spec:e2e": "jest test/e2e-repo.spec.ts", | ||
|
@@ -73,45 +86,48 @@ | |
] | ||
}, | ||
"dependencies": { | ||
"@mdn/browser-compat-data": "^5.3.16", | ||
"@mdn/browser-compat-data": "^5.5.19", | ||
"ast-metadata-inferer": "^0.8.0", | ||
"browserslist": "^4.21.10", | ||
"caniuse-lite": "^1.0.30001534", | ||
"browserslist": "^4.23.0", | ||
"caniuse-lite": "^1.0.30001605", | ||
"find-up": "^5.0.0", | ||
"globals": "^13.24.0", | ||
"lodash.memoize": "^4.1.2", | ||
"semver": "^7.5.4" | ||
"semver": "^7.6.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.24.3", | ||
"@babel/eslint-parser": "^7.24.1", | ||
"@semantic-release/changelog": "^6.0.3", | ||
"@semantic-release/git": "^10.0.1", | ||
"@tsconfig/node16": "^16.1.1", | ||
"@types/benchmark": "^2.1.3", | ||
"@types/browserslist": "^4.15.0", | ||
"@types/caniuse-lite": "^1.0.2", | ||
"@types/eslint": "^8.44.2", | ||
"@types/jest": "^29.5.5", | ||
"@types/lodash.memoize": "^4.1.7", | ||
"@types/semver": "7.5.2", | ||
"@typescript-eslint/eslint-plugin": "^6.7.0", | ||
"@typescript-eslint/parser": "^6.7.0", | ||
"babel-eslint": "^10.1.0", | ||
"@tsconfig/node16": "^16.1.3", | ||
"@types/benchmark": "^2.1.5", | ||
"@types/caniuse-lite": "^1.0.5", | ||
"@types/eslint": "^8.56.7", | ||
"@types/jest": "^29.5.12", | ||
"@types/lodash.memoize": "^4.1.9", | ||
"@types/semver": "7.5.8", | ||
"@typescript-eslint/eslint-plugin": "^7.5.0", | ||
"@typescript-eslint/parser": "^7.5.0", | ||
"benchmark": "^2.1.4", | ||
"browserslist-config-erb": "^0.0.3", | ||
"electron": "^26.x.x", | ||
"eslint": "^8.49.0", | ||
"eslint-config-airbnb-typescript": "^17.1.0", | ||
"electron": "^29.x.x", | ||
"eslint": "^8.57.0", | ||
"eslint-config-airbnb-typescript": "^18.0.0", | ||
"eslint-config-bliss-typescript": "^6.0.2", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-plugin-eslint-plugin": "^5.1.1", | ||
"eslint-plugin-import": "^2.28.1", | ||
"eslint-plugin-prettier": "^5.0.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-eslint-plugin": "^5.5.0", | ||
"eslint-plugin-import": "^2.29.1", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"expect-type": "^0.19.0", | ||
"jest": "^29.7.0", | ||
"prettier": "^3.0.3", | ||
"semantic-release": "^22.0.0", | ||
"simple-git": "^3.19.1", | ||
"ts-jest": "^29.1.1", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^5.2.2" | ||
"prettier": "^3.2.5", | ||
"semantic-release": "^22.0.12", | ||
"simple-git": "^3.24.0", | ||
"ts-jest": "^29.1.2", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^5.4.3", | ||
"typescript-eslint": "^7.5.0" | ||
}, | ||
"peerDependencies": { | ||
"eslint": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,33 @@ | ||
// Reconmmended configs for this plugin | ||
export default { | ||
plugins: ["compat"], | ||
env: { | ||
browser: true, | ||
/** | ||
* @file Recommended configs for this plugin | ||
*/ | ||
|
||
import globals from "globals"; | ||
import type { ESLint, Linter } from "eslint"; | ||
|
||
// Flat config: https://eslint.org/docs/latest/use/configure/configuration-files-new | ||
const flat = { | ||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
}, | ||
}, | ||
rules: { | ||
"compat/compat": "error", | ||
}, | ||
} satisfies Linter.FlatConfig; | ||
|
||
// eslintrc config: https://eslint.org/docs/latest/use/configure/configuration-files | ||
const legacy = { | ||
env: { | ||
browser: true, | ||
}, | ||
rules: flat.rules, | ||
} satisfies ESLint.ConfigData; | ||
|
||
const recommended = { | ||
flat, | ||
legacy, | ||
}; | ||
|
||
export default recommended; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -267,4 +267,4 @@ export default { | |
}, | ||
}; | ||
}, | ||
}; | ||
} as Rule.RuleModule; |
Oops, something went wrong.