From 53b53aacdd51f345f9ac99e2b31b3b7f46cb9d2a Mon Sep 17 00:00:00 2001 From: Hazmi35 Date: Tue, 18 Jan 2022 06:40:04 +0700 Subject: [PATCH] feat(main): [max-len] ignore urls strings, templateLiterals, and RegExpLiterals --- .eslintrc.json | 9 ++++++++- index.js | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index b3215b4..5269324 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -141,7 +141,14 @@ "keyword-spacing": ["warn", { "before": true, "after": true }], "linebreak-style": ["error", "unix"], "lines-between-class-members": ["warn", "always", { "exceptAfterSingleLine": true }], - "max-len": ["warn", { "code": 180, "tabWidth": 4 }], + "max-len": ["warn", { + "code": 180, + "tabWidth": 4, + "ignoreUrls": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreRegExpLiterals": true + }], "max-statements-per-line": ["warn", { "max": 3 }], "multiline-ternary": ["warn", "always-multiline"], "new-parens": "warn", diff --git a/index.js b/index.js index 3122112..9aa47d7 100644 --- a/index.js +++ b/index.js @@ -3,6 +3,7 @@ const { resolve } = require("path"); const { readFileSync } = require("fs"); const stripJsonComments = require("strip-json-comments"); +// TODO: Why dont just place everything here instead of .eslintrc.json? const file = readFileSync(resolve(__dirname, ".eslintrc.json")).toString(); module.exports = JSON.parse(stripJsonComments(file));