Skip to content

Commit 1801d4a

Browse files
NamitBhutaniCommunity-Programmerdependabot[bot]
authored
Lint only updated files stricter linting and update the PR workflow (PalisadoesFoundation#1677)
* Replace package vm2 with isolated-vm (PalisadoesFoundation#1532) * Replace package vm2 with isolated-vm * Removed package isolated-vm * init: lint-staged for linting staged files only * feat: convert warn to error in eslintrc * fix: failing tests * fix: package.json * fix: package-lock * chore(deps): bump follow-redirects from 1.15.3 to 1.15.4 (PalisadoesFoundation#1668) Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.3 to 1.15.4. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](follow-redirects/follow-redirects@v1.15.3...v1.15.4) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat: workflow job runs for changed files in the pushed commit only * fix: resolve conflict with upstream/develop * fix:package-lock * fix: attemp#2 merge conflict * fix: merge conflict #3 * fix: npm script instead of npx, filter git diff command * fix: package.json conflict * fix: remove vite * resolve merge conflict * attempt #2 fix conflict * update package-lock * update package-lock --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Sarthak Patel <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent fb4caca commit 1801d4a

File tree

5 files changed

+13995
-1051
lines changed

5 files changed

+13995
-1051
lines changed

.eslintrc.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,20 @@
5757
],
5858

5959
// restrict the use of same package in multiple import statements
60-
"import/no-duplicates": "warn",
60+
"import/no-duplicates": "error",
6161

6262
// warn/1, error/2, off/0
63-
"tsdoc/syntax": "warn",
63+
"tsdoc/syntax": "error",
6464

6565
// Typescript Rules
66-
"@typescript-eslint/ban-ts-comment": "warn",
67-
"@typescript-eslint/no-explicit-any": "warn",
68-
"@typescript-eslint/no-inferrable-types": "warn",
69-
"@typescript-eslint/no-non-null-asserted-optional-chain": "warn",
70-
"@typescript-eslint/no-non-null-assertion": "warn",
71-
"@typescript-eslint/no-var-requires": "warn",
72-
"@typescript-eslint/ban-types": "warn",
73-
"@typescript-eslint/no-duplicate-enum-values": "warn",
66+
"@typescript-eslint/ban-ts-comment": "error",
67+
"@typescript-eslint/no-explicit-any": "error",
68+
"@typescript-eslint/no-inferrable-types": "error",
69+
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
70+
"@typescript-eslint/no-non-null-assertion": "error",
71+
"@typescript-eslint/no-var-requires": "error",
72+
"@typescript-eslint/ban-types": "error",
73+
"@typescript-eslint/no-duplicate-enum-values": "error",
7474

7575
// Typescript rule to enforce PascalCase naming convention for types and interfaces
7676
"@typescript-eslint/naming-convention": [
@@ -115,9 +115,9 @@
115115
],
116116

117117
// Typescript additional rules
118-
"@typescript-eslint/array-type": "warn",
119-
"@typescript-eslint/consistent-type-assertions": "warn",
120-
"@typescript-eslint/consistent-type-imports": "warn",
121-
"@typescript-eslint/explicit-function-return-type": "warn"
118+
"@typescript-eslint/array-type": "error",
119+
"@typescript-eslint/consistent-type-assertions": "error",
120+
"@typescript-eslint/consistent-type-imports": "error",
121+
"@typescript-eslint/explicit-function-return-type": "error"
122122
}
123123
}

.github/workflows/pull-request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ jobs:
4949
- name: Install Dependencies
5050
run: npm ci
5151

52-
- name: Run ESLint to check for linting errors
53-
run: npm run lint:check
52+
- name: Run ESLint to check for linting errors in modified files
53+
run: npx eslint $(git diff --name-only --diff-filter=d -- '***.ts' ${{ github.event.before }} ${{ github.sha }})
5454

5555
- name: Check for formatting errors
5656
run: npm run format:check

.husky/pre-commit

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@
66
# Change to the current directory
77
. "$(dirname -- "$0")/_/husky.sh"
88

9-
# Formats code using prettier.
10-
npm run format:fix
11-
129
# Checks code for typescript type errors and throws errors if found.
1310
npm run typecheck
1411

12+
# Formats code using prettier
1513
# Checks and fixes all lint issues in code which don't require manual intervention.
1614
# Throws errors if lint issues requiring manual intervention are found in code.
17-
npm run lint:fix
15+
npm run lint-staged
1816

1917
npm run gen:schema
2018

0 commit comments

Comments
 (0)