File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -632,10 +632,17 @@ Your project's eslint configuration will now extend the default **lab** configur
632632
633633### Ignoring files in linting
634634
635- Since [ eslint] ( http://eslint.org/ ) is used to lint, you can create an ` .eslintignore ` containing paths to be ignored:
636- ```
637- node_modules/*
638- **/vendor/*.js
635+ 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,
636+ and add an ` ignores ` rule containing paths to be ignored. Here is an example preserving default hapi rules:
637+ ``` javascript
638+ import HapiPlugin from ' @hapi/eslint-plugin' ;
639+
640+ export default [
641+ {
642+ ignores: [' node_modules/*' , ' **/vendor/*.js' ],
643+ },
644+ ... HapiPlugin .configs .module ,
645+ ];
639646```
640647
641648### Only run linting
Original file line number Diff line number Diff line change @@ -21,7 +21,10 @@ exports.lint = async function () {
2121
2222 if ( ! Fs . existsSync ( 'eslint.config.js' ) &&
2323 ! Fs . existsSync ( 'eslint.config.cjs' ) &&
24- ! Fs . existsSync ( 'eslint.config.mjs' ) ) {
24+ ! Fs . existsSync ( 'eslint.config.mjs' ) &&
25+ ! Fs . existsSync ( 'eslint.config.ts' ) &&
26+ ! Fs . existsSync ( 'eslint.config.mts' ) &&
27+ ! Fs . existsSync ( 'eslint.config.cts' ) ) {
2528 // No configuration file found, using the default one
2629 usingDefault = true ;
2730 configuration . baseConfig = require ( './.eslintrc.js' ) ;
You can’t perform that action at this time.
0 commit comments