Skip to content

Commit b17e491

Browse files
author
Brett Zamir
committed
- Linting: Ignore ignore for linting
- Testing: Ignore `ignore` for nyc coverage - Build: Avoid Rollup `external` warnings
1 parent 7e61956 commit b17e491

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ node_modules
22
dist
33
docs/ts
44
coverage
5+
ignore
56
!*.js

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
"dist",
118118
"demo",
119119
"docs",
120+
"ignore",
120121
"test",
121122
"test-helpers"
122123
]

rollup.config.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,20 @@ import pkg from './package.json';
1212
* @param {PlainObject} config
1313
* @param {string} config.input
1414
* @param {boolean} config.minifying
15+
* @param {string[]} [config.external]
1516
* @param {string} [config.environment=""]
1617
* @param {string} [config.format="umd"]
1718
* @returns {external:RollupConfig}
1819
*/
1920
function getRollupObject ({
20-
input, minifying, environment, format = 'umd'
21+
input, minifying, environment,
22+
// eslint-disable-next-line no-shadow
23+
external,
24+
format = 'umd'
2125
}) {
2226
const nonMinified = {
2327
input,
28+
external,
2429
output: {
2530
format,
2631
sourcemap: minifying,
@@ -63,9 +68,15 @@ function getRollupObject ({
6368
function getRollupObjectByEnv ({minifying, environment}) {
6469
const input = `src/jsonpath-${environment}.js`;
6570
if (environment === 'node') {
71+
// eslint-disable-next-line no-shadow
72+
const external = ['vm'];
6673
return [
67-
getRollupObject({input, minifying, environment, format: 'cjs'}),
68-
getRollupObject({input, minifying, environment, format: 'esm'})
74+
getRollupObject({
75+
input, minifying, environment, external, format: 'cjs'
76+
}),
77+
getRollupObject({
78+
input, minifying, environment, external, format: 'esm'
79+
})
6980
];
7081
}
7182
return [
@@ -74,7 +85,7 @@ function getRollupObjectByEnv ({minifying, environment}) {
7485
];
7586
}
7687

77-
// eslint-disable-next-line import/no-anonymous-default-export
88+
// eslint-disable-next-line import/no-anonymous-default-export -- Rollup config
7889
export default [
7990
...getRollupObjectByEnv({minifying: false, environment: 'node'}),
8091
// ...getRollupObjectByEnv({minifying: true, environment: 'node'}),

0 commit comments

Comments
 (0)