Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove jest, upgrade deps, cleanup code #350

Merged
merged 2 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/* eslint-env node */
module.exports = {
extends: [
/**
* Here I simply want to disable all rules. I feel like a pretty strict
* tsconfig already catches a lot of the recommended rules and I want to
* avoid any mental overhead of unnecessary "duplicated warnings/errors".
* If you want to go with the "default/recommended" version, simply
* uncomment the following lines in the extends array.
*/
// "eslint:recommended",
// "plugin:@typescript-eslint/recommended",
// "plugin:@typescript-eslint/recommended-requiring-type-checking",
/* This prettier extends is used to disable all the formatting rules that
* are enabled by the different "recommended" rules.
*/
// "prettier",
],
plugins: ["@typescript-eslint"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
},
/**
* You can use the rules inside these overrides to specify the rules you want
* to use on a one by one / case by case basis. If you simply want to go with
* the default, just remove or uncomment the whole "rules" section inside the
* "overrides" property, and you are done.
*
* The following rules are my personal preference and reflect a subset of the
* recommended options. They also include a lot of the more strict options NOT
* included in the recommended ones. My goal is to simplify having a
* consistent code base/code style, to avoid catchable bugs early and advocate
* for usage of newer features of the language.
**/
overrides: [
{
// Enables type checking for typescript files.
// Src for the overrides from here :
// https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslint-recommended.ts
files: ["*.ts", "*.tsx", "*.mts", "*.cts"],
rules: {
// "eslint" rules
// check https://eslint.org/docs/latest/rules/ for reference
"no-cond-assign": ["error", "always"],
eqeqeq: ["error"],
"no-constant-binary-expression": "error",
curly: "error",
"default-case": "error",
"default-case-last": "error",
"no-constant-condition": "error",
"no-duplicate-imports": "error",
"no-fallthrough": "error",
"use-isnan": "error",
"arrow-body-style": ["error", "always"],
"no-loss-of-precision": "error",
"no-promise-executor-return": "error",
// See "when not to use it", and check your use case, if you think this
// rule should be disabled.
"no-await-in-loop": "error",
"no-useless-escape": "error",
"prefer-object-spread": "error",
"prefer-spread": "error",
"no-empty": "error",
"no-useless-catch": "error",
// See "when not to use it", and check your use case, if you think this
// rule should be disabled.
"no-bitwise": "error",
// typescript-eslint rules
// check https://typescript-eslint.io/rules/ for reference
"@typescript-eslint/array-type": "error",
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
"@typescript-eslint/no-unnecessary-condition": "error",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-optional-chain": "error",
"@typescript-eslint/prefer-reduce-type-parameter": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/ban-types": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-unsafe-call": "error",
"@typescript-eslint/no-unsafe-return": "error",
"@typescript-eslint/no-unsafe-member-access": "error",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/restrict-plus-operands": "error",
},
},
],
root: true,
};
24 changes: 0 additions & 24 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
push:
branches:
- "*"
- "**"
# A pull request sent from a fork of the upstream repository could be manipulated to do harmful things.
# The upstream repository’s maintainer would have no protection against this attack, as pull requests
# can be sent by anyone who forks the repository on GitHub.
Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
push:
branches:
- "*"
- "**"

# A pull request sent from a fork of the upstream repository could be manipulated to do harmful things.
# The upstream repository’s maintainer would have no protection against this attack, as pull requests
Expand Down Expand Up @@ -55,12 +55,3 @@ jobs:
run: npm run build

- run: npm test

- name: Upload test coverage as artifact
if: |
github.ref == 'refs/heads/main'
&& startsWith(matrix.os, 'ubuntu')
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage
67 changes: 0 additions & 67 deletions __tests__/action.test.ts

This file was deleted.

8 changes: 0 additions & 8 deletions jest.config.js

This file was deleted.

Loading