From 0b2232d3616d458d90e95123c33187ee6424792e Mon Sep 17 00:00:00 2001 From: mshanemc Date: Thu, 27 Jun 2024 14:13:17 -0500 Subject: [PATCH 1/5] feat: no null/undefined in template literal --- index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/index.js b/index.js index a0d304a..a8e7642 100644 --- a/index.js +++ b/index.js @@ -32,7 +32,6 @@ module.exports = { '@typescript-eslint/restrict-template-expressions': [ 'error', { - allowNullish: true, allowBoolean: true, allowNumber: true, }, From df77ab935b1aa24c928bbf0bcfed40f5e47aaaf3 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Thu, 27 Jun 2024 15:24:21 -0500 Subject: [PATCH 2/5] chore: explicitly disallow nullish in template literals --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index a8e7642..dc8b812 100644 --- a/index.js +++ b/index.js @@ -32,6 +32,7 @@ module.exports = { '@typescript-eslint/restrict-template-expressions': [ 'error', { + allowNullish: false, allowBoolean: true, allowNumber: true, }, From 5beef8ed638c36f42d61fdc5160db6a347de6b2c Mon Sep 17 00:00:00 2001 From: mshanemc Date: Fri, 28 Jun 2024 11:21:36 -0500 Subject: [PATCH 3/5] refactor: looser about nullish templates in tests --- index.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index dc8b812..eca07be 100644 --- a/index.js +++ b/index.js @@ -32,7 +32,8 @@ module.exports = { '@typescript-eslint/restrict-template-expressions': [ 'error', { - allowNullish: false, + // true generally (so we get it in /test), we override it to false for src lower down + allowNullish: true, allowBoolean: true, allowNumber: true, }, @@ -93,6 +94,17 @@ module.exports = { }, ignorePatterns: ['*.js'], overrides: [ + { + files: ['src/**'], + '@typescript-eslint/restrict-template-expressions': [ + 'error', + { + allowNullish: false, + allowBoolean: true, + allowNumber: true, + }, + ], + }, { files: ['src/**'], rules: { From 8b10c60eb0e47554f7e108cace5827d6bf78e809 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Fri, 28 Jun 2024 12:49:58 -0500 Subject: [PATCH 4/5] refactor: correc file structure --- index.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/index.js b/index.js index eca07be..da57f65 100644 --- a/index.js +++ b/index.js @@ -95,19 +95,17 @@ module.exports = { ignorePatterns: ['*.js'], overrides: [ { - files: ['src/**'], - '@typescript-eslint/restrict-template-expressions': [ - 'error', - { - allowNullish: false, - allowBoolean: true, - allowNumber: true, - }, - ], - }, - { + // put stricter rules you only want to apply to production code here files: ['src/**'], rules: { + '@typescript-eslint/restrict-template-expressions': [ + 'error', + { + allowNullish: false, + allowBoolean: true, + allowNumber: true, + }, + ], 'import/no-extraneous-dependencies': [ 'error', { From a46cb486f141d2211c2d70e8e1e35d726d72292f Mon Sep 17 00:00:00 2001 From: mshanemc Date: Tue, 23 Jul 2024 17:06:30 -0500 Subject: [PATCH 5/5] test: non-stock ut to allow TS dep --- .github/workflows/test.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6d2d8fc..d7adc9b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,8 +8,13 @@ jobs: yarn-lockfile-check: uses: salesforcecli/github-workflows/.github/workflows/lockFileCheck.yml@main linux-unit-tests: - needs: yarn-lockfile-check - uses: salesforcecli/github-workflows/.github/workflows/unitTestsLinux.yml@main + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + - uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main + - run: yarn build + - run: yarn test lint-external: uses: ./.github/workflows/externalLint.yml strategy: @@ -39,5 +44,5 @@ jobs: - https://github.com/forcedotcom/source-deploy-retrieve with: - packageName: "eslint-config-salesforce-typescript" + packageName: 'eslint-config-salesforce-typescript' externalProjectGitUrl: ${{ matrix.externalProjectGitUrl }}