@ngrx/eslint-plugin 14.0.1 → 14.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngrx/eslint-plugin",
3
- "version": "14.0.1",
3
+ "version": "14.0.2",
4
4
  "description": "NgRx ESLint Plugin",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,7 +30,7 @@ function addNgRxESLintPlugin(schema) {
30
30
  json.overrides = [configurePlugin(schema.config)];
31
31
  }
32
32
  host.overwrite(eslintConfigPath, JSON.stringify(json, null, 2));
33
- context.logger.info("\n The NgRx ESLint Plugin is installed and configured with the '".concat(schema.config, "' config.\n\n If you want to change the configuration, please see ").concat(docs, ".\n "));
33
+ context.logger.info("\n The NgRx ESLint Plugin is installed and configured with the '".concat(schema.config, "' config.\n\n Take a look at the docs at ").concat(docs, " if you want to change the default configuration.\n "));
34
34
  return host;
35
35
  }
36
36
  catch (err) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../modules/eslint-plugin/schematics/ng-add/index.ts"],"names":[],"mappings":";;;;;AACA,4EAAoD;AAGpD,SAAwB,mBAAmB,CAAC,MAAc;IACxD,OAAO,UAAC,IAAU,EAAE,OAAyB;;QAC3C,IAAM,gBAAgB,GAAG,gBAAgB,CAAC;QAC1C,IAAM,IAAI,GAAG,qCAAqC,CAAC;QAEnD,IAAM,MAAM,GAAG,MAAA,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,0CAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC9D,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,iDACc,gBAAgB,uFAG3C,IAAI,4CAChB,CAAC,CAAC;YACG,OAAO,IAAI,CAAC;SACb;QAED,IAAI;YACF,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,gCA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M,CAAC;YACf,SAAO,EAAE,CAAC,uBAAgB,MAAM,CAAE,CAAC;SACpC,CAAC;IACJ,CAAC;AACH,CAAC;AAjED,yCAiEC","sourcesContent":["import type { Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport stripJsonComments from 'strip-json-comments';\nimport type { Schema } from './schema';\n\nexport default function addNgRxESLintPlugin(schema: Schema): Rule {\n return (host: Tree, context: SchematicContext) => {\n const eslintConfigPath = '.eslintrc.json';\n const docs = 'https://ngrx.io/guide/eslint-plugin';\n\n const eslint = host.read(eslintConfigPath)?.toString('utf-8');\n if (!eslint) {\n context.logger.warn(`\nCould not find the ESLint config at \\`${eslintConfigPath}\\`.\nThe NgRx ESLint Plugin is installed but not configured.\n\nPlease see ${docs} to configure the NgRx ESLint Plugin.\n`);\n return host;\n }\n\n try {\n const json = JSON.parse(stripJsonComments(eslint));\n if (json.overrides) {\n if (\n !json.overrides.some((override: any) =>\n override.extends?.some((extend: any) =>\n extend.startsWith('plugin:@ngrx')\n )\n )\n ) {\n json.overrides.push(configurePlugin(schema.config));\n }\n } else if (\n !json.extends?.some((extend: any) => extend.startsWith('plugin:@ngrx'))\n ) {\n json.overrides = [configurePlugin(schema.config)];\n }\n\n host.overwrite(eslintConfigPath, JSON.stringify(json, null, 2));\n\n context.logger.info(`\n The NgRx ESLint Plugin is installed and configured with the '${schema.config}' config.\n\n If you want to change the configuration, please see ${docs}.\n `);\n return host;\n } catch (err) {\n const detailsContent =\n err instanceof Error\n ? `\nDetails:\n${err.message}\n`\n : '';\n context.logger.warn(`\nSomething went wrong while adding the NgRx ESLint Plugin.\nThe NgRx ESLint Plugin is installed but not configured.\n\nPlease see ${docs} to configure the NgRx ESLint Plugin.\n${detailsContent}\n`);\n }\n };\n function configurePlugin(config: Schema['config']): Record<string, unknown> {\n return {\n files: ['*.ts'],\n extends: [`plugin:@ngrx/${config}`],\n };\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../modules/eslint-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AgB,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAEhE,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,2EACuC,MAAM,CAAC,MAAM,uDAE/C,IAAI,0DAChC,CAAC,CAAC;YACC,OAAO,IAAI,CAAC;SACb;QAAC,OAAO,GAAG,EAAE;YACZ,IAAM,cAAc,GAClB,GAAG,YAAY,KAAK;gBAClB,CAAC,CAAC,sBAEV,GAAG,CAAC,OAAO,OACZ;gBACS,CAAC,CAAC,EAAE,CAAC;YACT,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,6IAIb,IAAI,oDACf,cAAc,OACf,CAAC,CAAC;SACE;IACH,CAAC,CAAC;IACF,SAAS,eAAe,CAAC,MAAwB;QAC/C,OAAO;YACL,KAAK,EAAE,CAAC,MAAM,CAAC;YACf,SAAO,EAAE,CAAC,uBAAgB,MAAM,CAAE,CAAC;SACpC,CAAC;IACJ,CAAC;AACH,CAAC;AAjED,yCAiEC","sourcesContent":["import type { Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport stripJsonComments from 'strip-json-comments';\nimport type { Schema } from './schema';\n\nexport default function addNgRxESLintPlugin(schema: Schema): Rule {\n return (host: Tree, context: SchematicContext) => {\n const eslintConfigPath = '.eslintrc.json';\n const docs = 'https://ngrx.io/guide/eslint-plugin';\n\n const eslint = host.read(eslintConfigPath)?.toString('utf-8');\n if (!eslint) {\n context.logger.warn(`\nCould not find the ESLint config at \\`${eslintConfigPath}\\`.\nThe NgRx ESLint Plugin is installed but not configured.\n\nPlease see ${docs} to configure the NgRx ESLint Plugin.\n`);\n return host;\n }\n\n try {\n const json = JSON.parse(stripJsonComments(eslint));\n if (json.overrides) {\n if (\n !json.overrides.some((override: any) =>\n override.extends?.some((extend: any) =>\n extend.startsWith('plugin:@ngrx')\n )\n )\n ) {\n json.overrides.push(configurePlugin(schema.config));\n }\n } else if (\n !json.extends?.some((extend: any) => extend.startsWith('plugin:@ngrx'))\n ) {\n json.overrides = [configurePlugin(schema.config)];\n }\n\n host.overwrite(eslintConfigPath, JSON.stringify(json, null, 2));\n\n context.logger.info(`\n The NgRx ESLint Plugin is installed and configured with the '${schema.config}' config.\n\n Take a look at the docs at ${docs} if you want to change the default configuration.\n `);\n return host;\n } catch (err) {\n const detailsContent =\n err instanceof Error\n ? `\nDetails:\n${err.message}\n`\n : '';\n context.logger.warn(`\nSomething went wrong while adding the NgRx ESLint Plugin.\nThe NgRx ESLint Plugin is installed but not configured.\n\nPlease see ${docs} to configure the NgRx ESLint Plugin.\n${detailsContent}\n`);\n }\n };\n function configurePlugin(config: Schema['config']): Record<string, unknown> {\n return {\n files: ['*.ts'],\n extends: [`plugin:@ngrx/${config}`],\n };\n }\n}\n"]}