Skip to content

Commit

Permalink
chore: update eslint ecma version
Browse files Browse the repository at this point in the history
  • Loading branch information
mjeanroy committed Sep 3, 2023
1 parent 2d42e4c commit 3afa9ac
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"google"
],
"parserOptions": {
"ecmaVersion": 6
"ecmaVersion": 2020
},
"env": {
"es6": true,
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const config = require('../config');

module.exports = gulp.series(
buildOutput,
copyTypings
copyTypings,
);

// eslint-disable-next-line require-jsdoc
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function createReleaseTask(level) {
prepareRelease,
performRelease,
tagRelease,
prepareNextRelease
prepareNextRelease,
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/generate-block-comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function generateBlockComment(text, commentStyle) {
options.style = new commenting.Style(
commentStyle.body,
commentStyle.start,
commentStyle.end
commentStyle.end,
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default function rollupPluginLicense(options = {}) {
.reject((mod) => mod[1].isAsset)
.filter((mod) => mod[1].renderedLength > 0)
.map((mod) => mod[0])
.value()
.value(),
);

return plugin.prependBanner(code, outputOptions.sourcemap !== false);
Expand Down
2 changes: 1 addition & 1 deletion src/license-plugin-option.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function validateOptions(options) {

if (!_.isEmpty(messages)) {
throw new Error(
`[${PLUGIN_NAME}] -- Error during validation of option object: ${messages.join(' ; ')}`
`[${PLUGIN_NAME}] -- Error during validation of option object: ${messages.join(' ; ')}`,
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/license-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class LicensePlugin {

// Read `package.json` file
const pkgJson = JSON.parse(
fs.readFileSync(pkgPath, 'utf-8')
fs.readFileSync(pkgPath, 'utf-8'),
);

// We are probably in a package.json specifying the type of package (module, cjs).
Expand Down Expand Up @@ -591,6 +591,6 @@ class LicensePlugin {
*/
export function licensePlugin(options) {
return new LicensePlugin(
licensePluginOptions(options)
licensePluginOptions(options),
);
}
2 changes: 1 addition & 1 deletion test/integration/it.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ describe('rollup-plugin-license', () => {
nodeResolve(),
commonjs(),
licensePlugin(
licensePluginOptions
licensePluginOptions,
),
],
};
Expand Down
14 changes: 7 additions & 7 deletions test/license-plugin-option.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ describe('licensePluginOptions', () => {
expect(result).toEqual(options);

expect(warn).toHaveBeenCalledWith(
'[rollup-plugin-license] -- Unknown property: "foo", allowed options are: sourcemap, debug, cwd, banner, thirdParty.'
'[rollup-plugin-license] -- Unknown property: "foo", allowed options are: sourcemap, debug, cwd, banner, thirdParty.',
);

expect(warn).toHaveBeenCalledWith(
'[rollup-plugin-license] -- Unknown property: "banner.bar", allowed options are: sourcemap, debug, cwd, banner, thirdParty.'
'[rollup-plugin-license] -- Unknown property: "banner.bar", allowed options are: sourcemap, debug, cwd, banner, thirdParty.',
);
});

Expand All @@ -77,7 +77,7 @@ describe('licensePluginOptions', () => {
};

expect(() => licensePluginOptions(options)).toThrow(new Error(
'[rollup-plugin-license] -- Error during validation of option object: "debug" must be a boolean'
'[rollup-plugin-license] -- Error during validation of option object: "debug" must be a boolean',
));

expect(warn).not.toHaveBeenCalledWith();
Expand All @@ -91,7 +91,7 @@ describe('licensePluginOptions', () => {
};

expect(() => licensePluginOptions(options)).toThrow(new Error(
'[rollup-plugin-license] -- Error during validation of option object: "debug" must be a boolean ; "cwd" must be a string'
'[rollup-plugin-license] -- Error during validation of option object: "debug" must be a boolean ; "cwd" must be a string',
));

expect(warn).not.toHaveBeenCalledWith();
Expand Down Expand Up @@ -127,7 +127,7 @@ describe('licensePluginOptions', () => {
};

expect(() => licensePluginOptions(options)).toThrow(new Error(
'[rollup-plugin-license] -- Error during validation of option object: "thirdParty.output[0]" is null.'
'[rollup-plugin-license] -- Error during validation of option object: "thirdParty.output[0]" is null.',
));
});

Expand All @@ -141,7 +141,7 @@ describe('licensePluginOptions', () => {
};

expect(() => licensePluginOptions(options)).toThrow(new Error(
'[rollup-plugin-license] -- Error during validation of option object: "thirdParty.output[0]" is undefined.'
'[rollup-plugin-license] -- Error during validation of option object: "thirdParty.output[0]" is undefined.',
));
});

Expand All @@ -158,7 +158,7 @@ describe('licensePluginOptions', () => {
'[rollup-plugin-license] -- Error during validation of option object: ' +
'"thirdParty.output[0]" must be a function OR ' +
'"thirdParty.output[0]" must be a string OR ' +
'"thirdParty.output[0]" must be an object'
'"thirdParty.output[0]" must be an object',
));
});
});
18 changes: 9 additions & 9 deletions test/license-plugin.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe('LicensePlugin', () => {
});

expect(warn).toHaveBeenCalledWith(
'[rollup-plugin-license] -- Unknown property: "foobar", allowed options are: sourcemap, debug, cwd, banner, thirdParty.'
'[rollup-plugin-license] -- Unknown property: "foobar", allowed options are: sourcemap, debug, cwd, banner, thirdParty.',
);
});

Expand Down Expand Up @@ -438,7 +438,7 @@ describe('LicensePlugin', () => {

expect(plugin._dependencies).toEqual({});
expect(warn).toHaveBeenCalledWith(
'[rollup-plugin-license] -- Trying to add dependency without any name, skipping it.'
'[rollup-plugin-license] -- Trying to add dependency without any name, skipping it.',
);
});

Expand Down Expand Up @@ -592,7 +592,7 @@ describe('LicensePlugin', () => {
});

expect(() => instance.prependBanner('var foo = 0;')).toThrow(new Error(
'[rollup-plugin-license] -- Cannot find banner content, please specify an inline content, or a path to a file'
'[rollup-plugin-license] -- Cannot find banner content, please specify an inline content, or a path to a file',
));
});

Expand Down Expand Up @@ -645,7 +645,7 @@ describe('LicensePlugin', () => {
});

expect(() => instance.prependBanner(code)).toThrow(new Error(
`[rollup-plugin-license] -- Template file ${file} does not exist, or cannot be read`
`[rollup-plugin-license] -- Template file ${file} does not exist, or cannot be read`,
));
});

Expand Down Expand Up @@ -744,7 +744,7 @@ describe('LicensePlugin', () => {
});

expect(() => instance.prependBanner(code)).toThrow(new Error(
'Unknown comment style foobar, please use one of: regular,ignored,slash,none'
'Unknown comment style foobar, please use one of: regular,ignored,slash,none',
));
});

Expand Down Expand Up @@ -1460,7 +1460,7 @@ describe('LicensePlugin', () => {
instance.addDependency(mitDependency);

expect(() => instance.scanThirdParties()).toThrow(new Error(
'Dependency "baz" does not specify any license.'
'Dependency "baz" does not specify any license.',
));
});

Expand All @@ -1480,21 +1480,21 @@ describe('LicensePlugin', () => {
instance.addDependency(mitDependency);

expect(() => instance.scanThirdParties()).toThrow(new Error(
'Dependency "foo" has a license (Apache-2.0) which is not compatible with requirement, looks like a license violation to fix.'
'Dependency "foo" has a license (Apache-2.0) which is not compatible with requirement, looks like a license violation to fix.',
));
});

function verifyWarnAboutApache2License() {
expect(warn).toHaveBeenCalledWith(
'[rollup-plugin-license] -- ' +
'Dependency "foo" has a license (Apache-2.0) which is not compatible with requirement, ' +
'looks like a license violation to fix.'
'looks like a license violation to fix.',
);
}

function verifyWarnAboutUnlicensedLicense() {
expect(warn).toHaveBeenCalledWith(
'[rollup-plugin-license] -- Dependency "baz" does not specify any license.'
'[rollup-plugin-license] -- Dependency "baz" does not specify any license.',
);
}
});
Expand Down
2 changes: 1 addition & 1 deletion test/person.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ describe('Person', () => {
});

expect(person.text()).toBe(
'Mickael Jeanroy <mickael.jeanroy@gmail.com> (https://mjeanroy.com)'
'Mickael Jeanroy <mickael.jeanroy@gmail.com> (https://mjeanroy.com)',
);
});
});

0 comments on commit 3afa9ac

Please sign in to comment.