File tree Expand file tree Collapse file tree 10 files changed +47
-58
lines changed
Expand file tree Collapse file tree 10 files changed +47
-58
lines changed Original file line number Diff line number Diff line change 99 "commit" : false ,
1010 "fixed" : [],
1111 "linked" : [],
12- "access" : " public " ,
12+ "access" : " restricted " ,
1313 "baseBranch" : " main" ,
1414 "updateInternalDependencies" : " patch" ,
1515 "ignore" : []
Original file line number Diff line number Diff line change 1+ ---
2+ " @menglinmaker/eslint-plugin-runtime-compat " : minor
3+ ---
4+
5+ Simplified apis and added comprehensive test suite
Original file line number Diff line number Diff line change 1- name : CD
1+ name : Changesets
22on :
3- workflow_run :
4- workflows : [CI]
5- branches : [main]
6- types : [completed]
7-
8- concurrency : ${{ github.workflow }}-${{ github.ref }}
3+ push :
4+ branches :
5+ - main
96
107permissions :
118 contents : write
@@ -14,7 +11,6 @@ permissions:
1411
1512jobs :
1613 release :
17- if : ${{ github.event.workflow_run.conclusion == 'success' }}
1814 runs-on : ubuntu-latest
1915 steps :
2016 - uses : actions/checkout@v4
@@ -28,15 +24,16 @@ jobs:
2824
2925 - run : pnpm install
3026 - run : pnpm build
27+ - run : pnpm lint
28+ - run : pnpm test
3129
32- - name : Create Release Pull Request or Publish to npm
33- id : changesets
30+ - name : Update and publish versions
3431 uses : changesets/action@v1
3532 with :
36- publish : pnpm release
3733 version : pnpm run version
3834 commit : " chore: new release"
3935 title : " chore: new release candidate"
36+ publish : pnpm release
4037 env :
4138 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4239 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change @@ -32,15 +32,16 @@ npm install @menglinmaker/eslint-plugin-runtime-compat
3232```
3333
34342 . Add ` eslint.config.mjs ` to root. This detects incompatible APIs for all runtimes in the dataset.
35- ``` Bash
36- import runtimeCompat from " @menglinmaker/eslint-plugin-runtime-compat" ;
35+ ``` JavaScript
36+ import runtimeCompat from ' @menglinmaker/eslint-plugin-runtime-compat'
37+ import tseslint from ' typescript-eslint'
3738
38- export default [runtimeCompat.configs.strict];
39+ export default [... tseslint . configs . recommended , ... runtimeCompat .configs .strict ]
3940```
4041
4142Alternatively, you can load a custom config:
42- ``` Bash
43- export default [ runtimeCompat.configs.custom([' node' , ' bun' , ' deno' ])] ;
43+ ``` JavaScript
44+ runtimeCompat .configs .custom ([' node' , ' bun' , ' deno' ])
4445```
4546
4647## Limitations:
Original file line number Diff line number Diff line change 11import runtimeCompat from '@menglinmaker/eslint-plugin-runtime-compat'
22import tseslint from 'typescript-eslint'
33
4- export default [
5- ...tseslint . configs . recommended ,
6- runtimeCompat . configs . recommended ,
7- {
8- languageOptions : {
9- parserOptions : {
10- projectService : {
11- allowDefaultProject : [ '*.js' ] ,
12- } ,
13- tsconfigRootDir : import . meta. dirname ,
14- } ,
15- } ,
16- } ,
17- ]
4+ export default [ ...tseslint . configs . recommended , ...runtimeCompat . configs . strict ]
Original file line number Diff line number Diff line change 11{
2+ "name" : " @eslint-plugin-runtime-compat/import-package-compat" ,
23 "private" : true ,
34 "type" : " module" ,
45 "scripts" : {
Original file line number Diff line number Diff line change 11import runtimeCompat from '@menglinmaker/eslint-plugin-runtime-compat'
22import tseslint from 'typescript-eslint'
33
4- export default [
5- ...tseslint . configs . recommended ,
6- runtimeCompat . configs . recommended ,
7- {
8- languageOptions : {
9- parserOptions : {
10- projectService : {
11- allowDefaultProject : [ '*.js' ] ,
12- } ,
13- tsconfigRootDir : import . meta. dirname ,
14- } ,
15- } ,
16- } ,
17- ]
4+ export default [ ...tseslint . configs . recommended , ...runtimeCompat . configs . strict ]
Original file line number Diff line number Diff line change 11{
2+ "name" : " @eslint-plugin-runtime-compat/internal-package-compat" ,
3+
24 "private" : true ,
35 "type" : " module" ,
46 "scripts" : {
Original file line number Diff line number Diff line change 99 "build" : " turbo build" ,
1010 "clean" : " rimraf packages/**/dist & rimraf .turbo packages/**/.turbo & rimraf node_modules packages/**/node_modules" ,
1111 "knip" : " knip" ,
12+ "changeset" : " changeset" ,
1213 "version" : " changeset version" ,
1314 "release" : " changeset publish"
1415 },
Original file line number Diff line number Diff line change @@ -9,25 +9,33 @@ import { runtimeCompatRule } from './rules'
99 * @param ruleConfig - List of runtimes to check.
1010 * @returns Generated flat-config for ESLint.
1111 */
12- const runtimeCompatPlugin = ( filterRuntimes : RuntimeName [ ] ) => ( {
13- plugins : {
14- 'runtime-compat' : {
15- meta : {
16- name : pkg . name ,
17- version : pkg . version ,
18- } ,
19- rules : {
20- 'runtime-compat' : runtimeCompatRule ( filterRuntimes ) ,
12+ const runtimeCompatPlugin = ( filterRuntimes : RuntimeName [ ] ) => [
13+ {
14+ plugins : {
15+ 'runtime-compat' : {
16+ meta : {
17+ name : pkg . name ,
18+ version : pkg . version ,
19+ } ,
20+ rules : {
21+ 'runtime-compat' : runtimeCompatRule ( filterRuntimes ) ,
22+ } ,
2123 } ,
2224 } ,
25+ rules : {
26+ 'runtime-compat/runtime-compat' : 'error' ,
27+ } ,
2328 } ,
24- rules : {
25- 'runtime-compat/runtime-compat' : 'error' ,
29+ {
30+ languageOptions : {
31+ parserOptions : {
32+ projectService : true ,
33+ } ,
34+ } ,
2635 } ,
27- } )
36+ ]
2837
2938export const configs = {
30- recommended : runtimeCompatPlugin ( supportedRuntimes ) ,
3139 strict : runtimeCompatPlugin ( supportedRuntimes ) ,
3240 custom : runtimeCompatPlugin ,
3341}
You can’t perform that action at this time.
0 commit comments