diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 83c6ada4..00000000 --- a/.eslintignore +++ /dev/null @@ -1,9 +0,0 @@ -/node_modules/ -/coverage/ -/bundle/ -/vendor/ -/dist/ -/lib/ -/out/ -!.eslintrc.js -!.eslintplugin/ diff --git a/.eslintrc.js b/.eslintrc.js index a04de952..fedee9d6 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -13,6 +13,7 @@ const config = { './@typescript-eslint.js', 'plugin:eslint-plugin/recommended' ], + ignorePatterns: ['!.eslintplugin/'], overrides: [ { files: ['*.spec.*'], extends: ['./jest.js'] }, { diff --git a/README.md b/README.md index ee015c82..89a409ad 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,25 @@ Install this package: #### `.eslintignore` -You can use the `.eslintignore` file used by this repo. It includes relevant files for TypeScript, Ruby, and PHP projects. +The configurations provided in this package specify `ignorePatterns` with common +folders to be ignored as part of best practice, meaning an `.eslintignore` file +is not required. + +Projects can use this property themselves instead of an `.eslintignore` to +ignore additional files & folders, using standard ignore-glob syntax: + +```js +/** @type {import('eslint').Linter.Config} */ +const config = { + extends: ['ackama'], + ignorePatterns: ['!.myFile.js', 'test/fixtures', '!test/fixtures/**.ts'] +}; + +module.exports = config; +``` + +As `ignorePatterns` is merged across all configs being extended from, you can +use `!` to un-ignore entries. #### @typescript-eslint diff --git a/index.js b/index.js index 2fff7c27..82d83ef1 100644 --- a/index.js +++ b/index.js @@ -11,6 +11,17 @@ const config = { 'plugin:prettier/recommended', 'plugin:eslint-comments/recommended' ], + ignorePatterns: [ + '!.eslintrc.js', + 'node_modules/', + 'coverage/', + 'bundle/', + 'public/', + 'vendor/', + 'dist/', + 'lib/', + 'out/' + ], rules: { 'eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }], 'eslint-comments/no-unused-disable': 'error', diff --git a/package.json b/package.json index 07dcd969..f47e488e 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "react.js" ], "scripts": { - "lint": "eslint . --ignore-pattern '!.eslintrc.js' --ext js,ts", + "lint": "eslint . --ext js,ts", "release": "semantic-release -r git+ssh://git@github.com/ackama/eslint-config-ackama.git", "test": "jest", "typecheck": "tsc --noEmit" @@ -88,7 +88,7 @@ "typescript": "^3.8.3" }, "peerDependencies": { - "eslint": ">= 6", + "eslint": ">= 6.7", "eslint-plugin-eslint-comments": ">= 3", "eslint-plugin-prettier": ">= 3.1", "prettier": ">= 1.19"