From dd068c2710ed2446465f177f018233a46629c0ba Mon Sep 17 00:00:00 2001 From: Nathan Nichols Date: Thu, 23 Sep 2021 21:04:07 -0700 Subject: [PATCH] build: adjust for updates to @xrplf/eslint-config (#1633) --- .eslintrc.js | 21 +++++++-------------- package-lock.json | 14 +++++++------- package.json | 2 +- src/client/connection.ts | 2 +- src/client/index.ts | 4 ++-- test/connection.ts | 1 + 6 files changed, 19 insertions(+), 25 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 0d48b144..ac4c4a8b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -68,22 +68,13 @@ module.exports = { { files: ['test/**/*.ts'], rules: { - // Removed the max for test files and test helper files, since tests usually need to import more things - 'import/max-dependencies': 'off', - - // describe blocks count as a function in Mocha tests, and can be insanely long - 'max-lines-per-function': 'off', - - // Tests can be very long turns off max-line count - 'max-lines': 'off', - - // We have lots of statements in tests - 'max-statements': 'off', - // We have lots of magic numbers in tests - 'no-magic-number': 'off', '@typescript-eslint/no-magic-numbers': 'off', + // We have files with a lot of tests + 'max-lines-per-function': 'off', + 'max-lines': 'off', + // We need to test things without type guards sometimes '@typescript-eslint/no-unsafe-assignment': 'off', '@typescript-eslint/no-unsafe-call': 'off', @@ -117,7 +108,6 @@ module.exports = { { files: ['test/models/*.ts'], rules: { - '@typescript-eslint/consistent-type-assertions': 'off', '@typescript-eslint/no-explicit-any': 'off', }, }, @@ -129,6 +119,9 @@ module.exports = { // Removed this as eslint prevents us from doing this differently 'import/unambiguous': 'off', + + // Javascript files have CommonJS exports + 'import/no-unused-modules': 'off', }, }, ], diff --git a/package-lock.json b/package-lock.json index 1b44a1d9..e2687686 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,7 @@ "@types/puppeteer": "5.4.4", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.0.0", - "@xrplf/eslint-config": "^1.3.0", + "@xrplf/eslint-config": "^1.4.0", "@xrplf/prettier-config": "^1.2.0", "assert": "^2.0.0", "buffer": "^6.0.2", @@ -1294,9 +1294,9 @@ } }, "node_modules/@xrplf/eslint-config": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@xrplf/eslint-config/-/eslint-config-1.3.0.tgz", - "integrity": "sha512-Zk3ZgzHxj8vozA87LF6Gv4B9v8KXH51Q4oW2sG4fCFHsqiSWVG+n4ZPr7DhTqPNhaxV21yL3OqsT7G6FgD1wXg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@xrplf/eslint-config/-/eslint-config-1.4.0.tgz", + "integrity": "sha512-tSpFzcQinykGrmF/kFgKumtQrIkpeOwAsCCEOmJC7f2uo6soZVB4EK0GPJ+l1uYN5o35YR34cEAPz+bBodJ6sw==", "dev": true, "dependencies": { "confusing-browser-globals": "^1.0.9", @@ -9557,9 +9557,9 @@ "requires": {} }, "@xrplf/eslint-config": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@xrplf/eslint-config/-/eslint-config-1.3.0.tgz", - "integrity": "sha512-Zk3ZgzHxj8vozA87LF6Gv4B9v8KXH51Q4oW2sG4fCFHsqiSWVG+n4ZPr7DhTqPNhaxV21yL3OqsT7G6FgD1wXg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@xrplf/eslint-config/-/eslint-config-1.4.0.tgz", + "integrity": "sha512-tSpFzcQinykGrmF/kFgKumtQrIkpeOwAsCCEOmJC7f2uo6soZVB4EK0GPJ+l1uYN5o35YR34cEAPz+bBodJ6sw==", "dev": true, "requires": { "confusing-browser-globals": "^1.0.9", diff --git a/package.json b/package.json index f4a960d3..ed451a4d 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@types/puppeteer": "5.4.4", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.0.0", - "@xrplf/eslint-config": "^1.3.0", + "@xrplf/eslint-config": "^1.4.0", "@xrplf/prettier-config": "^1.2.0", "assert": "^2.0.0", "buffer": "^6.0.2", diff --git a/src/client/connection.ts b/src/client/connection.ts index 29793582..7e10dd5e 100644 --- a/src/client/connection.ts +++ b/src/client/connection.ts @@ -1,4 +1,4 @@ -/* eslint-disable max-lines -- Connection is a big class */ +/* eslint-disable max-lines -- Connection is a large file w/ lots of imports/exports */ import { EventEmitter } from 'events' import { Agent } from 'http' diff --git a/src/client/index.ts b/src/client/index.ts index 6d30b69f..33c8aeb8 100644 --- a/src/client/index.ts +++ b/src/client/index.ts @@ -1,5 +1,5 @@ -/* eslint-disable @typescript-eslint/member-ordering -- Okay for Client so that client methods can be near the bottom */ -/* eslint-disable max-lines -- This might not be necessary later, but this file needs to be big right now */ +/* eslint-disable @typescript-eslint/member-ordering -- TODO: remove when instance methods aren't members */ +/* eslint-disable max-lines -- Client is a large file w/ lots of imports/exports */ import * as assert from 'assert' import { EventEmitter } from 'events' diff --git a/test/connection.ts b/test/connection.ts index 0fe55eac..f061737e 100644 --- a/test/connection.ts +++ b/test/connection.ts @@ -1,3 +1,4 @@ +/* eslint-disable max-statements -- test has a lot of statements */ import net from 'net' import { assert } from 'chai'