Skip to content

Commit

Permalink
Lint only updated files with stricter linting (PalisadoesFoundation#1635
Browse files Browse the repository at this point in the history
)

* 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

---------

Co-authored-by: Sarthak Patel <[email protected]>
  • Loading branch information
2 people authored and AVtheking committed Jan 8, 2024
1 parent 7f95bab commit 284505e
Show file tree
Hide file tree
Showing 4 changed files with 13,459 additions and 877 deletions.
30 changes: 15 additions & 15 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@
],

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

// warn/1, error/2, off/0
"tsdoc/syntax": "warn",
// error/1, error/2, off/0
"tsdoc/syntax": "error",

// Typescript Rules
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-inferrable-types": "warn",
"@typescript-eslint/no-non-null-asserted-optional-chain": "warn",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-var-requires": "warn",
"@typescript-eslint/ban-types": "warn",
"@typescript-eslint/no-duplicate-enum-values": "warn",
"@typescript-eslint/ban-ts-comment": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/ban-types": "error",
"@typescript-eslint/no-duplicate-enum-values": "error",

// Typescript rule to enforce PascalCase naming convention for types and interfaces
"@typescript-eslint/naming-convention": [
Expand Down Expand Up @@ -115,9 +115,9 @@
],

// Typescript additional rules
"@typescript-eslint/array-type": "warn",
"@typescript-eslint/consistent-type-assertions": "warn",
"@typescript-eslint/consistent-type-imports": "warn",
"@typescript-eslint/explicit-function-return-type": "warn"
"@typescript-eslint/array-type": "error",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/explicit-function-return-type": "error"
}
}
6 changes: 2 additions & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@
# Change to the current directory
. "$(dirname -- "$0")/_/husky.sh"

# Formats code using prettier.
npm run format:fix

# Checks code for typescript type errors and throws errors if found.
npm run typecheck

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

npm run gen:schema

Expand Down
Loading

0 comments on commit 284505e

Please sign in to comment.