Skip to content

Commit

Permalink
Update gulpfile example in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
fasttime committed Jul 7, 2024
1 parent 674c170 commit 60ec31f
Showing 1 changed file with 29 additions and 9 deletions.
38 changes: 29 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,41 @@ src(['scripts/*.js']) // Read files.
Or use the plugin API to do things like:

```javascript
gulp.src(['**/*.js', '!node_modules/**'])
// gulpfile.mjs
import js from '@eslint/js';
import jquery from 'eslint-plugin-jquery';
import globals from 'globals';
import gulp from 'gulp';
import gulpESLintNew from 'gulp-eslint-new';

export default
() =>
gulp.src(['**/*.{js,mjs}', '!node_modules/**'])
.pipe
(
gulpESLintNew
(
{
configType: 'flat',
overrideConfig:
{
env: { browser: true, commonjs: true, jquery: true },
extends: ['eslint:recommended', 'plugin:jquery/slim'],
globals: { chrome: 'readonly' },
plugins: ['jquery'],
rules: { 'strict': 'error' },
},
warnIgnored: true,
[
js.configs.recommended,
jquery.configs.slim,
{
languageOptions:
{
globals:
{
...globals.browser,
...globals.jquery,
chrome: 'readonly',
},
},
rules: { 'strict': 'error' },
},
],
plugins: { jquery },
warnIgnored: true,
},
),
)
Expand Down

0 comments on commit 60ec31f

Please sign in to comment.