Skip to content

Commit 60ec31f

Browse files
committed
Update gulpfile example in README.md
1 parent 674c170 commit 60ec31f

File tree

1 file changed

+29
-9
lines changed

1 file changed

+29
-9
lines changed

README.md

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,41 @@ src(['scripts/*.js']) // Read files.
5353
Or use the plugin API to do things like:
5454

5555
```javascript
56-
gulp.src(['**/*.js', '!node_modules/**'])
56+
// gulpfile.mjs
57+
import js from '@eslint/js';
58+
import jquery from 'eslint-plugin-jquery';
59+
import globals from 'globals';
60+
import gulp from 'gulp';
61+
import gulpESLintNew from 'gulp-eslint-new';
62+
63+
export default
64+
() =>
65+
gulp.src(['**/*.{js,mjs}', '!node_modules/**'])
5766
.pipe
5867
(
5968
gulpESLintNew
6069
(
6170
{
71+
configType: 'flat',
6272
overrideConfig:
63-
{
64-
env: { browser: true, commonjs: true, jquery: true },
65-
extends: ['eslint:recommended', 'plugin:jquery/slim'],
66-
globals: { chrome: 'readonly' },
67-
plugins: ['jquery'],
68-
rules: { 'strict': 'error' },
69-
},
70-
warnIgnored: true,
73+
[
74+
js.configs.recommended,
75+
jquery.configs.slim,
76+
{
77+
languageOptions:
78+
{
79+
globals:
80+
{
81+
...globals.browser,
82+
...globals.jquery,
83+
chrome: 'readonly',
84+
},
85+
},
86+
rules: { 'strict': 'error' },
87+
},
88+
],
89+
plugins: { jquery },
90+
warnIgnored: true,
7191
},
7292
),
7393
)

0 commit comments

Comments
 (0)