From 85d37ba2835d12ba56611946edf18fdea6655a2e Mon Sep 17 00:00:00 2001 From: Tobiah Date: Thu, 16 Mar 2023 20:32:04 -0500 Subject: [PATCH] feat: nest configs, allow underscore dangle --- .eslintrc.js => configs/.eslintrc.js | 6 ++++++ esm.js => configs/.eslintrc.mjs | 0 prettier.config.js => configs/prettier.config.js | 0 typescript.js => configs/typescript.js | 0 index.js | 3 --- package.json | 15 ++++++++------- 6 files changed, 14 insertions(+), 10 deletions(-) rename .eslintrc.js => configs/.eslintrc.js (94%) rename esm.js => configs/.eslintrc.mjs (100%) rename prettier.config.js => configs/prettier.config.js (100%) rename typescript.js => configs/typescript.js (100%) delete mode 100644 index.js diff --git a/.eslintrc.js b/configs/.eslintrc.js similarity index 94% rename from .eslintrc.js rename to configs/.eslintrc.js index 66f11d2..cae558e 100644 --- a/.eslintrc.js +++ b/configs/.eslintrc.js @@ -68,6 +68,12 @@ module.exports = { usePrettierrc: true, }, ], + 'no-underscore-dangle': [ + 'error', + { + allow: ['__basedir', '__dirname'], + }, + ], }, extends: ['airbnb-base', 'plugin:prettier/recommended'], plugins: ['no-null'], diff --git a/esm.js b/configs/.eslintrc.mjs similarity index 100% rename from esm.js rename to configs/.eslintrc.mjs diff --git a/prettier.config.js b/configs/prettier.config.js similarity index 100% rename from prettier.config.js rename to configs/prettier.config.js diff --git a/typescript.js b/configs/typescript.js similarity index 100% rename from typescript.js rename to configs/typescript.js diff --git a/index.js b/index.js deleted file mode 100644 index 4c4b737..0000000 --- a/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./.eslintrc'); diff --git a/package.json b/package.json index d6e2f5f..983de58 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "description": "Shared eslint configuration for Warframe Community Developers", "scripts": { "test": "npm run lint", - "lint": "eslint .", - "lint:fix": "eslint . --fix" + "lint": "eslint -c ./configs/.eslintrc.js .", + "lint:fix": "eslint -c ./configs/.eslintrc.js . --fix" }, "repository": { "type": "git", @@ -24,10 +24,10 @@ }, "homepage": "https://github.com/WFCD/eslint-config#readme", "exports": { - ".": "./index.js", - "./esm": "./esm.js", - "./prettier": "./prettier.config.js", - "./typescript": "./typescript.js" + ".": "./configs/.eslintrc.js", + "./esm": "./configs/.eslintrc.mjs", + "./prettier": "./configs/prettier.config.js", + "./typescript": "./configs/typescript.js" }, "peerDependencies": { "@babel/core": "^7.19.1", @@ -84,5 +84,6 @@ ] ], "branches": "main" - } + }, + "prettier": "./configs/prettier.config.js" }