From 3afa9ac0a6db7e7cdbb9784e8881973a46565290 Mon Sep 17 00:00:00 2001 From: Mickael Jeanroy Date: Sun, 3 Sep 2023 21:00:33 +0200 Subject: [PATCH] chore: update eslint ecma version --- .eslintrc | 2 +- scripts/build/index.js | 2 +- scripts/release/index.js | 2 +- src/generate-block-comment.js | 2 +- src/index.js | 2 +- src/license-plugin-option.js | 2 +- src/license-plugin.js | 4 ++-- test/integration/it.spec.js | 2 +- test/license-plugin-option.spec.js | 14 +++++++------- test/license-plugin.spec.js | 18 +++++++++--------- test/person.spec.js | 2 +- 11 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.eslintrc b/.eslintrc index dd04bfac..b1a84ce7 100644 --- a/.eslintrc +++ b/.eslintrc @@ -4,7 +4,7 @@ "google" ], "parserOptions": { - "ecmaVersion": 6 + "ecmaVersion": 2020 }, "env": { "es6": true, diff --git a/scripts/build/index.js b/scripts/build/index.js index af16c92f..12dbcd38 100644 --- a/scripts/build/index.js +++ b/scripts/build/index.js @@ -30,7 +30,7 @@ const config = require('../config'); module.exports = gulp.series( buildOutput, - copyTypings + copyTypings, ); // eslint-disable-next-line require-jsdoc diff --git a/scripts/release/index.js b/scripts/release/index.js index 571221aa..a2a8920c 100644 --- a/scripts/release/index.js +++ b/scripts/release/index.js @@ -109,7 +109,7 @@ function createReleaseTask(level) { prepareRelease, performRelease, tagRelease, - prepareNextRelease + prepareNextRelease, ); } diff --git a/src/generate-block-comment.js b/src/generate-block-comment.js index 94168d69..199acdbe 100644 --- a/src/generate-block-comment.js +++ b/src/generate-block-comment.js @@ -40,7 +40,7 @@ export function generateBlockComment(text, commentStyle) { options.style = new commenting.Style( commentStyle.body, commentStyle.start, - commentStyle.end + commentStyle.end, ); } diff --git a/src/index.js b/src/index.js index dbae191d..1b21c4cc 100644 --- a/src/index.js +++ b/src/index.js @@ -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); diff --git a/src/license-plugin-option.js b/src/license-plugin-option.js index 7b6d5ecb..d646c60d 100644 --- a/src/license-plugin-option.js +++ b/src/license-plugin-option.js @@ -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(' ; ')}`, ); } } diff --git a/src/license-plugin.js b/src/license-plugin.js index 293d06c5..d326aabd 100644 --- a/src/license-plugin.js +++ b/src/license-plugin.js @@ -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). @@ -591,6 +591,6 @@ class LicensePlugin { */ export function licensePlugin(options) { return new LicensePlugin( - licensePluginOptions(options) + licensePluginOptions(options), ); } diff --git a/test/integration/it.spec.js b/test/integration/it.spec.js index a9f04114..d5439e0d 100644 --- a/test/integration/it.spec.js +++ b/test/integration/it.spec.js @@ -297,7 +297,7 @@ describe('rollup-plugin-license', () => { nodeResolve(), commonjs(), licensePlugin( - licensePluginOptions + licensePluginOptions, ), ], }; diff --git a/test/license-plugin-option.spec.js b/test/license-plugin-option.spec.js index 22f1c3c1..5580208d 100644 --- a/test/license-plugin-option.spec.js +++ b/test/license-plugin-option.spec.js @@ -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.', ); }); @@ -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(); @@ -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(); @@ -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.', )); }); @@ -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.', )); }); @@ -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', )); }); }); diff --git a/test/license-plugin.spec.js b/test/license-plugin.spec.js index 02ede1b8..099d0314 100644 --- a/test/license-plugin.spec.js +++ b/test/license-plugin.spec.js @@ -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.', ); }); @@ -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.', ); }); @@ -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', )); }); @@ -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`, )); }); @@ -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', )); }); @@ -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.', )); }); @@ -1480,7 +1480,7 @@ 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.', )); }); @@ -1488,13 +1488,13 @@ describe('LicensePlugin', () => { 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.', ); } }); diff --git a/test/person.spec.js b/test/person.spec.js index 1b3def31..c7e56aed 100644 --- a/test/person.spec.js +++ b/test/person.spec.js @@ -112,7 +112,7 @@ describe('Person', () => { }); expect(person.text()).toBe( - 'Mickael Jeanroy (https://mjeanroy.com)' + 'Mickael Jeanroy (https://mjeanroy.com)', ); }); });