diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..3ced409 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,12 @@ +module.exports = { + root: true, + parser: '@typescript-eslint/parser', + plugins: [ + '@typescript-eslint', + ], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/recommended', + ], +}; diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..d48b7ec --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,15 @@ +on: + pull_request: + +jobs: + lint: + name: lint + runs-on: ubuntu-latest + steps: + - name: nodenv/setup-nodenv + uses: nodenv/actions-setup-nodenv@v2.0.4 + - uses: actions/checkout@v1 + - name: install eslint + run: npm install eslint@6.8.0 @typescript-eslint/parser@2.25.0 @typescript-eslint/eslint-plugin@2.25.0 + - name: lint + run: ./node_modules/.bin/eslint . --ext .ts diff --git a/package.json b/package.json index 2106f8d..6c1d5af 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,7 @@ }, "scripts": { "build": "tsc && bin/build.js", - "test": "npm run lint && jest src/test.js", - "lint": "tslint -c tslint.json 'src/index.ts' --fix", + "test": "jest src/test.js", "test:watch": "npm run test -- --watch" }, "license": "Apache-2.0", @@ -33,7 +32,6 @@ "json-schema-ref-parser": "^8.0.0", "lodash": "^4.17.11", "node-fetch": "^2.3.0", - "tslint": "^6.1.0", "typescript": "^3.3.3333" }, "keywords": [ diff --git a/tslint.json b/tslint.json deleted file mode 100644 index 0c18d59..0000000 --- a/tslint.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": [ - "tslint:recommended" - ], - "rules": { - "ordered-imports": false, - "indent": [true, "spaces", 2] - } -}