From a236dd1b573d0ca31f7f395bbfbb1b275a6f81af Mon Sep 17 00:00:00 2001 From: Nick McCurdy Date: Sun, 18 Aug 2019 19:20:10 -0400 Subject: [PATCH 1/3] Fix linter configuration for test files --- .eslintrc.js | 8 +++++--- package.json | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index dc9cb6c3da..eba873417d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -34,9 +34,11 @@ module.exports = { overrides: [ { - files: 'test/**/*.js', - env: { - jest: true + files: 'test/typescript/*.ts', + rules: { + 'no-unused-expressions': 'off', + '@typescript-eslint/no-namespace': 'off', + '@typescript-eslint/no-unused-vars': 'off' } } ] diff --git a/package.json b/package.json index 3f59918dd7..3eb2990dfe 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "clean": "rimraf lib dist es coverage", "format": "prettier --write \"{src,test}/**/*.{js,ts}\" index.d.ts \"**/*.md\"", "format:check": "prettier --list-different \"{src,test}/**/*.{js,ts}\" index.d.ts \"**/*.md\"", - "lint": "eslint src test", + "lint": "eslint --ext js,ts src test", "pretest": "npm run build", "test": "jest", "test:watch": "npm test -- --watch", From cdf168d9a783883e9a8da6a0a96d64f90223e72e Mon Sep 17 00:00:00 2001 From: Nick McCurdy Date: Sun, 18 Aug 2019 21:12:50 -0400 Subject: [PATCH 2/3] Add separate ESLint config to test/typescript --- .eslintrc.js | 13 +------------ test/typescript/.eslintrc.js | 7 +++++++ 2 files changed, 8 insertions(+), 12 deletions(-) create mode 100644 test/typescript/.eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js index eba873417d..4e01bf55a7 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -30,16 +30,5 @@ module.exports = { argsIgnorePattern: '^_' // ignore unused variables whose name is '_' } ] - }, - - overrides: [ - { - files: 'test/typescript/*.ts', - rules: { - 'no-unused-expressions': 'off', - '@typescript-eslint/no-namespace': 'off', - '@typescript-eslint/no-unused-vars': 'off' - } - } - ] + } } diff --git a/test/typescript/.eslintrc.js b/test/typescript/.eslintrc.js new file mode 100644 index 0000000000..d94f0a7925 --- /dev/null +++ b/test/typescript/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + rules: { + 'no-unused-expressions': 'off', + '@typescript-eslint/no-namespace': 'off', + '@typescript-eslint/no-unused-vars': 'off' + } +} From 6e8071c20efff55943c486bfc549c879032ff2a7 Mon Sep 17 00:00:00 2001 From: Nick McCurdy Date: Sun, 18 Aug 2019 21:20:47 -0400 Subject: [PATCH 3/3] Also lint TypeScript files in examples --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3eb2990dfe..a420204899 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "build": "rollup -c", "prepare": "npm run clean && npm run check-types && npm run format:check && npm run lint && npm test", "check-types": "tsc", - "examples:lint": "eslint examples", + "examples:lint": "eslint --ext js,ts examples", "examples:test": "cross-env CI=true babel-node examples/testAll.js" }, "dependencies": {