Skip to content

Commit

Permalink
chore(copyright): update rollup config to use correct copyright (#3967)
Browse files Browse the repository at this point in the history
new legal name (since 2022) and always use current year
  • Loading branch information
wjhsf authored Feb 1, 2024
1 parent d9ada42 commit 25eba02
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 104 deletions.
209 changes: 107 additions & 102 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,16 @@
"sourceType": "module"
},

"plugins": [
"jest",
"@lwc/lwc-internal",
"@typescript-eslint",
"import",
"header"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended"
],
"plugins": ["jest", "@lwc/lwc-internal", "@typescript-eslint", "import", "header"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/eslint-recommended"],

"env": {
"es6": true
},

"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{ "argsIgnorePattern": "^_" }
],
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],

"block-scoped-var": "error",
"no-alert": "error",
Expand All @@ -42,92 +30,121 @@
"no-proto": "error",
"no-prototype-builtins": "error",
"no-new-require": "error",
"no-restricted-properties": ["error", {
"object": "arguments",
"property": "callee",
"message": "arguments.callee is deprecated"
}, {
"object": "global",
"property": "isFinite",
"message": "Please use Number.isFinite instead"
}, {
"object": "self",
"property": "isFinite",
"message": "Please use Number.isFinite instead"
}, {
"object": "window",
"property": "isFinite",
"message": "Please use Number.isFinite instead"
}, {
"object": "global",
"property": "isNaN",
"message": "Please use Number.isNaN instead"
}, {
"object": "self",
"property": "isNaN",
"message": "Please use Number.isNaN instead"
}, {
"object": "window",
"property": "isNaN",
"message": "Please use Number.isNaN instead"
}, {
"property": "__defineGetter__",
"message": "Please use Object.defineProperty instead."
}, {
"property": "__defineSetter__",
"message": "Please use Object.defineProperty instead."
}, {
"object": "Math",
"property": "pow",
"message": "Use the exponentiation operator (**) instead."
}, {
"object": "globalThis",
"property": "lwcRuntimeFlags",
"message": "Use the bare global lwcRuntimeFlags instead."
}],
"no-restricted-properties": [
"error",
{
"object": "arguments",
"property": "callee",
"message": "arguments.callee is deprecated"
},
{
"object": "global",
"property": "isFinite",
"message": "Please use Number.isFinite instead"
},
{
"object": "self",
"property": "isFinite",
"message": "Please use Number.isFinite instead"
},
{
"object": "window",
"property": "isFinite",
"message": "Please use Number.isFinite instead"
},
{
"object": "global",
"property": "isNaN",
"message": "Please use Number.isNaN instead"
},
{
"object": "self",
"property": "isNaN",
"message": "Please use Number.isNaN instead"
},
{
"object": "window",
"property": "isNaN",
"message": "Please use Number.isNaN instead"
},
{
"property": "__defineGetter__",
"message": "Please use Object.defineProperty instead."
},
{
"property": "__defineSetter__",
"message": "Please use Object.defineProperty instead."
},
{
"object": "Math",
"property": "pow",
"message": "Use the exponentiation operator (**) instead."
},
{
"object": "globalThis",
"property": "lwcRuntimeFlags",
"message": "Use the bare global lwcRuntimeFlags instead."
}
],
"no-self-compare": "error",
"no-undef-init": "error",
"no-useless-computed-key": "error",
"no-useless-return": "error",
"prefer-const": ["error", {
"destructuring": "any",
"ignoreReadBeforeAssign": true
}],
"prefer-const": [
"error",
{
"destructuring": "any",
"ignoreReadBeforeAssign": true
}
],
"template-curly-spacing": "error",
"yoda": "error",

"@lwc/lwc-internal/no-invalid-todo": "error",
"import/order": [
"error",
{ "groups": ["builtin", "external", "internal", "parent", "index", "sibling", "object", "type"] }
{
"groups": [
"builtin",
"external",
"internal",
"parent",
"index",
"sibling",
"object",
"type"
]
}
],
"no-restricted-imports": [
"error",
{
"name": "@lwc/features",
"importNames": ["lwcRuntimeFlags", "runtimeFlags", "default"],
"message": "Do not directly import runtime flags from @lwc/features. Use the global lwcRuntimeFlags variable instead."
}
],
"no-restricted-imports": ["error", {
"name": "@lwc/features",
"importNames": ["lwcRuntimeFlags", "runtimeFlags", "default"],
"message": "Do not directly import runtime flags from @lwc/features. Use the global lwcRuntimeFlags variable instead."
}],
"header/header": [
2,
"block",
[
"",
{
"pattern": "^ \\* Copyright \\(c\\) \\d{4}, ([sS]alesforce.com, inc|Salesforce, Inc)\\.$",
"template": " * Copyright (c) 2024, Salesforce, Inc."
},
" * All rights reserved.",
" * SPDX-License-Identifier: MIT",
" * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT",
" "
"",
{
"pattern": "^ \\* Copyright \\(c\\) \\d{4}, ([sS]alesforce.com, inc|Salesforce, Inc)\\.$",
// This copyright text should match the text used in the rollup config
"template": " * Copyright (c) 2024, Salesforce, Inc."
},
" * All rights reserved.",
" * SPDX-License-Identifier: MIT",
" * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT",
" "
]
]
]
},

"overrides": [
{
"files": [
"**/packages/lwc/**"
],
"files": ["**/packages/lwc/**"],
"rules": {
"no-restricted-imports": "off"
}
Expand All @@ -145,11 +162,7 @@
}
},
{
"files": [
"**/__tests__/**",
"**/__mocks__/**",
"**/@lwc/integration-karma/**"
],
"files": ["**/__tests__/**", "**/__mocks__/**", "**/@lwc/integration-karma/**"],

"env": {
"jest": true,
Expand All @@ -165,21 +178,15 @@
}
},
{
"files": [
"**/@lwc/integration-tests/**"
],
"files": ["**/@lwc/integration-tests/**"],

"globals": {
"$": true,
"browser": true
}
},
{
"files": [
"./*.js",
"**/scripts/**",
"**/jest.config.js"
],
"files": ["./*.js", "**/scripts/**", "**/jest.config.js"],

"env": {
"node": true,
Expand All @@ -191,9 +198,7 @@
}
},
{
"files": [
"**/perf-benchmarks/**"
],
"files": ["**/perf-benchmarks/**"],

"globals": {
"after": true,
Expand All @@ -204,13 +209,13 @@
},
{
"files": [
"packages/@lwc/integration-tests/src/**/!(*.spec.js)",
"packages/@lwc/integration-karma/test/**",
"packages/@lwc/integration-karma/test-hydration/**"
"packages/@lwc/integration-tests/src/**/!(*.spec.js)",
"packages/@lwc/integration-karma/test/**",
"packages/@lwc/integration-karma/test-hydration/**"
],
"rules": {
"header/header": "off"
"header/header": "off"
}
}
}
]
}
5 changes: 3 additions & 2 deletions scripts/rollup/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, salesforce.com, inc.
* Copyright (c) 2024, Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: MIT
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
Expand All @@ -19,7 +19,8 @@ const { nodeResolve } = require('@rollup/plugin-node-resolve');
const packageRoot = process.cwd();
const packageJson = JSON.parse(readFileSync(path.resolve(packageRoot, './package.json'), 'utf-8'));
const { name: packageName, version, dependencies, peerDependencies } = packageJson;
let banner = `/**\n * Copyright (C) 2023 salesforce.com, inc.\n */`;
// This copyright text should match the text in the header/header eslint rule
let banner = `/**\n * Copyright (c) ${new Date().getFullYear()} Salesforce, Inc.\n */`;
let footer = `/** version: ${version} */`;
const { ROLLUP_WATCH: watchMode } = process.env;
const formats = ['es', 'cjs'];
Expand Down

0 comments on commit 25eba02

Please sign in to comment.