Skip to content

Commit

Permalink
refactor: #158 configure no-undef eslint rule (#176)
Browse files Browse the repository at this point in the history
* removed tslint

* add eslint

* add default config

* setup default config and npm run command

* add command to node.js.yml

* set rules to support current codebase

* remove unused tslint.json

* include sample files in eslint command

* remove rule no-explicit-any

* specify type for timer

* remove any from filterKeys

* explictly declare that error can be Error, String but still accept any from the end users

* specify types in the sync worker

* improve the IndexableError type

* explain why any is allowed in CustomData

* remove no-this-alias from eslint config

* convert to arrow function to preserve this reference

* use arrow functions to remove the need of a this alias

* define httpoptions object instead of using this alias

* add examples to prettier command

* add prettier job to node js ci job

* script fix

* setup no-unused-vars lint rule

* remove unused var

* fixed lib/raygun.batch.ts

* fix lib/raygun.offline.ts

* cleanup lib/raygun.sync.transport.ts

* fix lib/raygun.transport.ts

* fix lib/raygun.ts

* fix @typescript-eslint/no-unused-vars

* fixs in test files

* update package lock in sample

* cleanup eslint config

* config files

* run npm run prettier

* chore: document why no-var-requires ignore is necessary

update comment

* fix: #158 configure no-undef eslint rule
  • Loading branch information
miquelbeltran committed May 6, 2024
1 parent 53769b1 commit 9d1606a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}
# Make sure the value of GITHUB_TOKEN will not be persisted in repo's config
Expand Down
12 changes: 11 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
languageOptions: {
// Add node globals to ignore undefined
globals: {
"__dirname": false,
"console": false,
"module": false,
"process": false,
"require": false,
"setTimeout": false,
}
},
rules: {
// Unused vars reported as error
"@typescript-eslint/no-unused-vars": [
Expand All @@ -19,7 +30,6 @@ export default tseslint.config(
// Required to import JS modules
"@typescript-eslint/no-var-requires": "off",
// TODO: Remove ignored rules and fix the code
"no-undef": "off",
"no-unreachable": "off",
"no-useless-catch": "off",
}
Expand Down
1 change: 1 addition & 0 deletions examples/using-domains/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ appDomain.run(function () {
// Or we can deal with it in our "Fake Error Handler" below

// This will throw an error as fakeErrorHandler doesn't exist
// eslint-disable-next-line
fakeErrorHandler.DealWith(err);
}
});
Expand Down

0 comments on commit 9d1606a

Please sign in to comment.