diff --git a/API.md b/API.md index 0b6d6dc0..df798668 100755 --- a/API.md +++ b/API.md @@ -632,10 +632,17 @@ Your project's eslint configuration will now extend the default **lab** configur ### Ignoring files in linting -Since [eslint](http://eslint.org/) is used to lint, you can create an `.eslintignore` containing paths to be ignored: -``` -node_modules/* -**/vendor/*.js +Since [eslint](http://eslint.org/) is used to lint, if you don't already have an `eslint.config.{js|cjs|mjs|ts|mts|cts}` you can create one, +and add an `ignores` rule containing paths to be ignored. Here is an example preserving default hapi rules: +```javascript +import HapiPlugin from '@hapi/eslint-plugin'; + +export default [ + { + ignores: ['node_modules/*', '**/vendor/*.js'], + }, + ...HapiPlugin.configs.module, +]; ``` ### Only run linting diff --git a/lib/linter/index.js b/lib/linter/index.js index 1deadf10..d1ec4a44 100755 --- a/lib/linter/index.js +++ b/lib/linter/index.js @@ -21,7 +21,10 @@ exports.lint = async function () { if (!Fs.existsSync('eslint.config.js') && !Fs.existsSync('eslint.config.cjs') && - !Fs.existsSync('eslint.config.mjs')) { + !Fs.existsSync('eslint.config.mjs') && + !Fs.existsSync('eslint.config.ts') && + !Fs.existsSync('eslint.config.mts') && + !Fs.existsSync('eslint.config.cts')) { // No configuration file found, using the default one usingDefault = true; configuration.baseConfig = require('./.eslintrc.js');