From 0219c075c7d79fa7864453468ed3f97c80d53634 Mon Sep 17 00:00:00 2001 From: LuanRT Date: Wed, 18 May 2022 05:51:54 -0300 Subject: [PATCH] chore: add linter --- .eslintignore | 7 ++++++ .eslintrc.yml | 45 ++++++++++++++++++++++++++++++++++++++ .github/workflows/lint.yml | 17 ++++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 .eslintignore create mode 100644 .eslintrc.yml create mode 100644 .github/workflows/lint.yml diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..36d8ba99 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,7 @@ +.git +.github +tests/ +cache/ +lib/proto/messages.js +coverage/ +node_modules/ \ No newline at end of file diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 00000000..bb8117ed --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,45 @@ +env: + commonjs: true + es2021: true + node: true +extends: eslint:recommended +parserOptions: + ecmaVersion: latest +rules: + max-len: + - error + - + code: 200 + ignoreComments: true + ignoreTrailingComments: true + ignoreStrings: true + ignoreTemplateLiterals: true + ignoreRegExpLiterals: true + + quotes: [error, single] + + no-template-curly-in-string: error + no-unreachable-loop: error + no-unused-private-class-members: error + no-prototype-builtins: 'off' + no-async-promise-executor: 'off' + no-case-declarations: 'off' + no-return-assign: 'off' + no-floating-decimal: error + no-implied-eval: error + arrow-spacing: error + no-invalid-this: error + no-lone-blocks: error + no-new-func: error + no-new-wrappers: error + no-new: error + no-void: error + no-octal-escape: error + no-self-compare: error + no-sequences: error + no-throw-literal: error + no-unmodified-loop-condition: error + no-useless-call: error + no-useless-concat: error + no-useless-escape: error + no-useless-return: error \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..16365850 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,17 @@ +name: Lint + +on: [push, pull_request] + +jobs: + eslint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + + - name: npm install and lint + run: | + npm install + npm run lint \ No newline at end of file