Skip to content

Commit

Permalink
Merge pull request #246 from forcedotcom/sm/prevent-null-undefined-in…
Browse files Browse the repository at this point in the history
…-template-literal

feat: no null/undefined in template literal
  • Loading branch information
mdonnalley committed Jul 24, 2024
2 parents 4e30e30 + a46cb48 commit 293b165
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}
10 changes: 10 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module.exports = {
'@typescript-eslint/restrict-template-expressions': [
'error',
{
// true generally (so we get it in /test), we override it to false for src lower down
allowNullish: true,
allowBoolean: true,
allowNumber: true,
Expand Down Expand Up @@ -94,8 +95,17 @@ module.exports = {
ignorePatterns: ['*.js'],
overrides: [
{
// 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',
{
Expand Down

0 comments on commit 293b165

Please sign in to comment.