gulp-eslint-new 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  ## Installation
6
6
 
7
7
  Make sure that you are using a version of Node.js supported by your version of ESLint.
8
- See prerequisites for [ESLint 8](https://eslint.org/docs/v8.x/use/getting-started#prerequisites) and [ESLint 9](https://eslint.org/docs/latest/use/getting-started#prerequisites).
8
+ See prerequisites for [ESLint 8](https://eslint.org/docs/v8.x/use/getting-started#prerequisites) and [ESLint 9](https://eslint.org/docs/v9.x/use/getting-started#prerequisites).
9
9
  For TypeScript support, you need TypeScript 4.6 or later.
10
10
 
11
11
  To install gulp-eslint-new, [use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm):
@@ -363,11 +363,11 @@ If this argument is `undefined`, a modified version of the ESLint "stylish" form
363
363
  // Use the default gulp-eslint-new formatter.
364
364
  gulpESLintNew.format()
365
365
 
366
- // Use the "checkstyle" ESLint formatter.
367
- gulpESLintNew.format('checkstyle')
366
+ // Use the "html" ESLint formatter.
367
+ gulpESLintNew.format('html')
368
368
 
369
369
  // Use "eslint-formatter-pretty" as a formatter (must be installed with `npm`).
370
- // See https://github.com/sindresorhus/eslint-formatter-pretty.
370
+ // See https://www.npmjs.com/package/eslint-formatter-pretty.
371
371
  gulpESLintNew.format('pretty')
372
372
  ```
373
373
 
@@ -1,6 +1,6 @@
1
+ import type { TransformCallback } from 'node:stream';
1
2
  import type * as eslint from './eslint';
2
3
  import 'node';
3
- import type { TransformCallback } from 'stream';
4
4
 
5
5
  type Awaitable<T = unknown> = T | Promise<T>;
6
6
 
package/lib/util.js CHANGED
@@ -122,29 +122,44 @@ exports.createIgnoreResult =
122
122
  {
123
123
  const { ltr } = require('semver');
124
124
  let message;
125
- const useEslintrcConfig = isEslintrcESLintConstructor(eslintConstructor);
126
125
  const relativePath = relative(baseDir, filePath);
127
- const eslintVersion = eslintConstructor.version;
128
- if (useEslintrcConfig && isHiddenRegExp.test(relativePath))
126
+ if (isEslintrcESLintConstructor(eslintConstructor))
129
127
  {
130
- message =
131
- 'File ignored by default. Use a negated ignore pattern (like ' +
132
- '"!<relative/path/to/filename>") to override.';
133
- }
134
- else if (isInNodeModulesRegExp.test(relativePath))
135
- {
136
- message =
137
- useEslintrcConfig || ltr(eslintVersion, '8.41') ?
138
- 'File ignored by default. Use a negated ignore pattern like "!node_modules/*" to ' +
139
- 'override.' :
140
- 'File ignored by default because it is located under the node_modules directory. Use ' +
141
- 'ignore pattern "!**/node_modules/" to override.';
128
+ if (isHiddenRegExp.test(relativePath))
129
+ {
130
+ message =
131
+ 'File ignored by default. Use a negated ignore pattern (like ' +
132
+ '"!<relative/path/to/filename>") to override.';
133
+ }
134
+ else if (isInNodeModulesRegExp.test(relativePath))
135
+ {
136
+ message =
137
+ 'File ignored by default. Use a negated ignore pattern like "!**/node_modules/*" to ' +
138
+ 'override.';
139
+ }
140
+ else
141
+ {
142
+ message =
143
+ 'File ignored because of a matching ignore pattern. Set "ignore" option to false to ' +
144
+ 'override.';
145
+ }
142
146
  }
143
147
  else
144
148
  {
145
- message =
146
- 'File ignored because of a matching ignore pattern. Set "ignore" option to false to ' +
147
- 'override.';
149
+ if (relativePath.startsWith('..'))
150
+ message = 'File ignored because outside of base path.';
151
+ else if (isInNodeModulesRegExp.test(relativePath))
152
+ {
153
+ message =
154
+ 'File ignored by default because it is located under the node_modules directory. Use ' +
155
+ 'ignore pattern "!**/node_modules/**" to override.';
156
+ }
157
+ else
158
+ {
159
+ message =
160
+ 'File ignored. If this file is matched by a global ignore pattern, it can be ' +
161
+ 'unignored by setting the "ignore" option to false.';
162
+ }
148
163
  }
149
164
  const result =
150
165
  {
@@ -156,7 +171,7 @@ exports.createIgnoreResult =
156
171
  fixableWarningCount: 0,
157
172
  fatalErrorCount: 0,
158
173
  };
159
- if (!ltr(eslintVersion, '8.8'))
174
+ if (!ltr(eslintConstructor.version, '8.8'))
160
175
  result.suppressedMessages = [];
161
176
  return result;
162
177
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gulp-eslint-new",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "A gulp plugin to lint code with ESLint 8 and 9.",
5
5
  "keywords": [
6
6
  "gulpplugin",
@@ -36,35 +36,36 @@
36
36
  "build": "npm install && gulp",
37
37
  "coverage": "gulp test",
38
38
  "lint": "eslint . --format compact",
39
+ "release": "git add CHANGELOG.md && npm version -f",
39
40
  "test": "mocha --check-leaks test/*.spec.js",
40
- "ts-test": "tsc --project test/tsconfig.json",
41
- "version": "git add CHANGELOG.md"
41
+ "ts-test": "tsc --project test/tsconfig.json"
42
42
  },
43
43
  "dependencies": {
44
- "@types/eslint": "^8.56.7",
44
+ "@types/eslint": "^8.56.10",
45
45
  "@types/node": ">=12",
46
46
  "eslint": "8 || 9",
47
47
  "fancy-log": "^2.0.0",
48
48
  "plugin-error": "^2.0.1",
49
- "semver": "^7.6.0",
49
+ "semver": "^7.6.2",
50
50
  "ternary-stream": "^3.0.0",
51
51
  "vinyl-fs": "^4.0.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@eslint/js": "^8.57.0",
55
- "@origin-1/eslint-config": "^0.23.0",
56
- "c8js": "^0.6.2",
55
+ "@origin-1/eslint-config": "^1.3.0",
56
+ "c8js": "^0.7.0",
57
57
  "eslint-8.0": "npm:eslint@8.0",
58
58
  "eslint-8.21": "npm:eslint@8.21",
59
59
  "eslint-8.x": "npm:eslint@8.x",
60
60
  "eslint-9.x": "npm:eslint@9.x",
61
61
  "eslint-config-~shareable": "file:test/config",
62
62
  "eslint-formatter-~formatter": "file:test/formatter",
63
- "eslint-plugin-tsdoc": "^0.2.17",
64
- "globals": "^15.0.0",
63
+ "eslint-formatter-compact": "^8.40.0",
64
+ "eslint-plugin-tsdoc": "^0.3.0",
65
+ "globals": "^15.4.0",
65
66
  "gulp": "^5.0.0",
66
67
  "mocha": "^9.2.2",
67
- "typescript": "~5.4.4",
68
+ "typescript": "~5.4.5",
68
69
  "typescript_4.6": "npm:typescript@4.6",
69
70
  "typescript_5": "npm:typescript@5",
70
71
  "vinyl": "^3.0.0"