Skip to content

Commit 4e85ed7

Browse files
authored
chore(all): fix lint issues (#1270)
1 parent 6090005 commit 4e85ed7

File tree

40 files changed

+286
-262
lines changed

40 files changed

+286
-262
lines changed

.github/workflows/node-windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ jobs:
3636
node-version: ${{ matrix.node }}
3737

3838
- name: install pnpm
39-
run: npm install pnpm@6 -g
39+
run: npm install pnpm@7 -g
4040

4141
- name: pnpm install
4242
run: pnpm install --ignore-scripts
4343

4444
- name: run tests
45-
run: pnpm ci:test --filter "...[origin/master]"
45+
run: pnpm --filter "...[origin/master]" ci:test

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
4444
- name: Install pnpm
4545
run: |
46-
npm install pnpm@6 -g;
46+
npm install pnpm@7 -g;
4747
echo node `pnpm -v`;
4848
4949
- name: Set Git Config
@@ -57,16 +57,16 @@ jobs:
5757
run: pnpm install
5858

5959
- name: Build Packages
60-
run: pnpm build --recursive
60+
run: pnpm --recursive build
6161

6262
- name: Lint Monorepo
6363
run: pnpm lint
6464

6565
- name: Run Tests
66-
run: pnpm test --filter [HEAD^]
66+
run: pnpm --filter [HEAD^] test
6767

6868
- name: Release and Publish Packages
69-
run: pnpm release --filter [HEAD^]
69+
run: pnpm --filter [HEAD^] release
7070
env:
7171
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
7272
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/validate.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
run: git branch -f master origin/master
3535

3636
- name: Install pnpm
37-
run: npm install pnpm@6 -g
37+
run: npm install pnpm@7 -g
3838

3939
- name: Sanity Check
4040
run: |
@@ -53,10 +53,10 @@ jobs:
5353
# run: pnpm security
5454

5555
- name: Build Packages
56-
run: pnpm build --recursive
56+
run: pnpm --recursive build
5757

5858
- name: Lint Monorepo
5959
run: pnpm lint:js
6060

6161
- name: Run Tests
62-
run: pnpm ci:coverage --filter "...[origin/master]"
62+
run: pnpm --filter "...[origin/master]" ci:coverage

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ enable-pre-post-scripts = true
44
link-workspace-packages = false
55
shamefully-hoist = true
66
shared-workspace-shrinkwrap = true
7+
strict-peer-dependencies = false

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ All plugin packages are kept in the `/packages` directory.
7373
#### Adding dependencies:
7474

7575
```console
76-
$ pnpm add <package> --filter ./packages/<name>
76+
$ pnpm --filter ./packages/<name> add <package>
7777
```
7878

7979
Where `<package>` is the name of the NPM package you wish to add for a plugin package, and `<name>` is the proper name of the plugin. e.g. `@rollup/plugin-beep`.
8080

8181
#### Publishing:
8282

8383
```console
84-
$ pnpm publish -- <name> [flags]
84+
$ pnpm publish <name> [flags]
8585
```
8686

8787
Where `<name>` is the portion of the plugin package name following `@rollup/plugin-`. (e.g. `beep`)
@@ -118,7 +118,7 @@ $ pnpm test
118118
To run tests on a specific package:
119119

120120
```console
121-
$ pnpm test --filter ./packages/<name>
121+
$ pnpm --filter ./packages/<name> test
122122
```
123123

124124
Linting:
@@ -132,10 +132,10 @@ $ pnpm lint
132132
To lint a specific package:
133133

134134
```console
135-
$ pnpm lint --filter ./packages/<name>
135+
$ pnpm --filter ./packages/<name> lint
136136
```
137137

138-
_Note: Scripts in the repository will run the root `test` and `lint` script on those packages which have changes. This is also how the CI pipelines function. To run either on a package outside of that pipeline, use `pnpm <script> -- @rollup/plugin-<name>`._
138+
_Note: Scripts in the repository will run the root `test` and `lint` script on those packages which have changes. This is also how the CI pipelines function. To run either on a package outside of that pipeline, use `pnpm <script> @rollup/plugin-<name>`._
139139

140140
## Adding Plugins
141141

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"husky": "8.0.1",
3737
"lint-staged": "11.0.1",
3838
"nyc": "^15.1.0",
39-
"pnpm": "6.10.0",
39+
"pnpm": "^7.12.2",
4040
"prettier": "^2.2.1",
4141
"prettier-plugin-package": "^1.3.0",
4242
"semver": "^7.3.2",

packages/alias/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"prepare": "if [ ! -d 'dist' ]; then pnpm build; fi",
2929
"prerelease": "pnpm build",
3030
"pretest": "pnpm build",
31-
"release": "pnpm plugin:release --workspace-root -- --pkg $npm_package_name",
31+
"release": "pnpm --workspace-root plugin:release --pkg $npm_package_name",
3232
"test": "ava",
3333
"test:ts": "tsc --noEmit"
3434
},

packages/auto-install/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"prepare": "if [ ! -d 'dist' ]; then pnpm build; fi",
2626
"prerelease": "pnpm build",
2727
"pretest": "pnpm build",
28-
"release": "pnpm plugin:release --workspace-root -- --pkg $npm_package_name",
28+
"release": "pnpm --workspace-root plugin:release --pkg $npm_package_name",
2929
"test": "ava",
3030
"test:ts": "tsc --noEmit"
3131
},

packages/babel/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"prebuild": "del-cli dist",
2828
"prerelease": "pnpm build",
2929
"pretest": "pnpm build",
30-
"release": "pnpm plugin:release --workspace-root -- --pkg $npm_package_name",
30+
"release": "pnpm --workspace-root plugin:release --pkg $npm_package_name",
3131
"test": "ava",
3232
"test:ts": "tsc types/index.d.ts test/types.ts --noEmit"
3333
},

packages/babel/test/as-input-plugin.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import * as fs from 'fs';
33

44
import test from 'ava';
55
import { rollup } from 'rollup';
6-
import { SourceMapConsumer } from 'source-map';
76
import jsonPlugin from '@rollup/plugin-json';
87
import nodeResolvePlugin from '@rollup/plugin-node-resolve';
98
import { createFilter } from '@rollup/pluginutils';
@@ -172,7 +171,15 @@ test('generates sourcemap by default', async (t) => {
172171
} = await bundle.generate({ format: 'cjs', exports: 'auto', sourcemap: true });
173172

174173
const target = 'log';
174+
175+
// source-map uses the presence of fetch to detect browser environments which
176+
// breaks in Node 18
177+
const { fetch } = global;
178+
delete global.fetch;
179+
const { SourceMapConsumer } = await import('source-map');
175180
const smc = await new SourceMapConsumer(map);
181+
global.fetch = fetch;
182+
176183
const loc = getLocation(code, code.indexOf(target));
177184
const original = smc.originalPositionFor(loc);
178185

0 commit comments

Comments
 (0)