@nx/eslint 20.1.0-canary.20241102-c290b37 → 20.1.0-canary.20241105-b925f8c

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/eslint",
3
- "version": "20.1.0-canary.20241102-c290b37",
3
+ "version": "20.1.0-canary.20241105-b925f8c",
4
4
  "private": false,
5
5
  "description": "The ESLint plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.",
6
6
  "repository": {
@@ -35,8 +35,8 @@
35
35
  "eslint": "^8.0.0 || ^9.0.0"
36
36
  },
37
37
  "dependencies": {
38
- "@nx/devkit": "20.1.0-canary.20241102-c290b37",
39
- "@nx/js": "20.1.0-canary.20241102-c290b37",
38
+ "@nx/devkit": "20.1.0-canary.20241105-b925f8c",
39
+ "@nx/js": "20.1.0-canary.20241105-b925f8c",
40
40
  "semver": "^7.5.3",
41
41
  "tslib": "^2.3.0",
42
42
  "typescript": "~5.4.2"
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.resolveAndInstantiateESLint = resolveAndInstantiateESLint;
4
+ const semver_1 = require("semver");
4
5
  const config_file_1 = require("../../../utils/config-file");
5
6
  const resolve_eslint_class_1 = require("../../../utils/resolve-eslint-class");
6
7
  async function resolveAndInstantiateESLint(eslintConfigPath, options, useFlatConfig = false) {
@@ -12,6 +13,7 @@ async function resolveAndInstantiateESLint(eslintConfigPath, options, useFlatCon
12
13
  const ESLint = await (0, resolve_eslint_class_1.resolveESLintClass)({
13
14
  useFlatConfigOverrideVal: useFlatConfig,
14
15
  });
16
+ // ruleFilter exist only in eslint 9+, remove this type when eslint 8 support dropped
15
17
  const eslintOptions = {
16
18
  overrideConfigFile: eslintConfigPath,
17
19
  fix: !!options.fix,
@@ -57,6 +59,10 @@ async function resolveAndInstantiateESLint(eslintConfigPath, options, useFlatCon
57
59
  eslintOptions.reportUnusedDisableDirectives =
58
60
  options.reportUnusedDisableDirectives || undefined;
59
61
  }
62
+ // pass --quiet to eslint 9+ directly: filter only errors
63
+ if (options.quiet && (0, semver_1.gte)(ESLint.version, '9.0.0')) {
64
+ eslintOptions.ruleFilter = (rule) => rule.severity === 2;
65
+ }
60
66
  const eslint = new ESLint(eslintOptions);
61
67
  return {
62
68
  ESLint,