eslint-config-angular-strict 22.6.3 โ†’ 22.6.4

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.
Files changed (3) hide show
  1. package/README.md +5 -3
  2. package/index.js +26 -1
  3. package/package.json +3 -1
package/README.md CHANGED
@@ -35,6 +35,8 @@ A production-ready, opinionated ESLint configuration that enforces best practice
35
35
  - ๐Ÿ…ฐ๏ธ [**Angular ESLint**](https://github.com/angular-eslint/angular-eslint) - Angular-specific rules
36
36
  - โš™๏ธ [**ESLint**](https://github.com/eslint/eslint) - Core linting engine
37
37
  - ๐Ÿ“ฆ [**Import-X**](https://github.com/un-ts/eslint-plugin-import-x) - Import/export validation and cycle detection
38
+ - ๐Ÿ—‚๏ธ [**JSON**](https://github.com/eslint/json) - JSON files parsing and linting
39
+ - ๐Ÿ“ [**Markdown**](https://github.com/eslint/markdown) - Markdown files parsing and linting
38
40
  - ๐Ÿ’… [**Perfectionist**](https://github.com/azat-io/eslint-plugin-perfectionist) - Take Your Code to a Beauty Salon
39
41
  - ๐ŸŽจ [**Stylistic**](https://github.com/eslint-stylistic/eslint-stylistic) - Code formatting rules
40
42
  - ๐Ÿงพ [**TOML**](https://github.com/ota-meshi/eslint-plugin-toml) - TOML files parsing and linting
@@ -76,9 +78,9 @@ Add the following to your `package.json`:
76
78
  }
77
79
  ```
78
80
 
79
- ### 4. Lint YAML and TOML files (optional)
81
+ ### 4. Lint JSON, Markdown, TOML and YAML files (optional)
80
82
 
81
- YAML and TOML files are checked against the `standard` preset of their plugin and the Unicorn rules recommended for them, but `ng lint` only looks at the patterns declared in `angular.json`. Add them there:
83
+ JSON, Markdown, TOML and YAML files are checked against the preset of their plugin (`recommended` for JSON and Markdown, `standard` for TOML and YAML) and the Unicorn rules recommended for them, but `ng lint` only looks at the patterns declared in `angular.json`. Add the ones you need there:
82
84
 
83
85
  ```jsonc
84
86
  {
@@ -86,7 +88,7 @@ YAML and TOML files are checked against the `standard` preset of their plugin an
86
88
  "lint": {
87
89
  "builder": "@angular-eslint/builder:lint",
88
90
  "options": {
89
- "lintFilePatterns": ["src/**/*.ts", "src/**/*.html", "**/*.toml", "**/*.yaml", "**/*.yml"],
91
+ "lintFilePatterns": ["src/**/*.ts", "src/**/*.html", "**/*.json", "**/*.md", "**/*.toml", "**/*.yaml", "**/*.yml"],
90
92
  },
91
93
  },
92
94
  }
package/index.js CHANGED
@@ -3,6 +3,8 @@ import angularEslintPlugin from '@angular-eslint/eslint-plugin';
3
3
  import angularTemplateParser from '@angular-eslint/template-parser';
4
4
  import angularTemplatePlugin from '@angular-eslint/eslint-plugin-template';
5
5
  import importXPlugin from 'eslint-plugin-import-x';
6
+ import jsonPlugin from '@eslint/json';
7
+ import markdownPlugin from '@eslint/markdown';
6
8
  import perfectionistPlugin from 'eslint-plugin-perfectionist';
7
9
  import stylistic from '@stylistic/eslint-plugin';
8
10
  import tomlPlugin from 'eslint-plugin-toml';
@@ -19,7 +21,8 @@ const enableAllRules = (plugin, prefix) => Object.fromEntries(Object.keys(plugin
19
21
  // The language plugins ship their presets as arrays whose rules carry no `files` โ€” merge them so they stay scoped to our own blocks
20
22
  const presetRules = preset => Object.assign({}, ...preset.map(config => config.rules));
21
23
 
22
- const dataFiles = ['**/*.toml', '**/*.yaml', '**/*.yml']; // Data files get their own language blocks below: the JavaScript presets must not reach them
24
+ // Data files get their own language blocks below: the JavaScript presets must not reach them
25
+ const dataFiles = ['**/*.json', '**/*.json5', '**/*.jsonc', '**/*.md', '**/*.toml', '**/*.yaml', '**/*.yml'];
23
26
 
24
27
  export default [
25
28
  { ignores: ['dist/**', 'node_modules/**'] }, // Alone in its object, `ignores` is global: mixed with other keys it only applies to that block
@@ -345,6 +348,28 @@ export default [
345
348
  },
346
349
  },
347
350
 
351
+ // JSON files configuration
352
+ {
353
+ files: ['**/*.json', '**/*.json5', '**/*.jsonc'],
354
+ plugins: { json: jsonPlugin, unicorn: unicornPlugin },
355
+ rules: { ...jsonPlugin.configs.recommended.rules, ...unicornPlugin.configs['recommended-json'].rules },
356
+ },
357
+ { files: ['**/*.json'], language: 'json/json' },
358
+ { files: ['**/*.json5'], language: 'json/json5' },
359
+ { files: ['**/*.jsonc', '**/.vscode/*.json', '**/tsconfig*.json'], language: 'json/jsonc' }, // these tolerate comments, and this block wins over the `.json` one
360
+
361
+ // Markdown files configuration
362
+ {
363
+ files: ['**/*.md'],
364
+ language: 'markdown/gfm',
365
+ plugins: { markdown: markdownPlugin, unicorn: unicornPlugin },
366
+ rules: {
367
+ ...presetRules(markdownPlugin.configs.recommended),
368
+ ...unicornPlugin.configs['recommended-markdown'].rules,
369
+ 'unicorn/filename-case': ['error', { ignore: ['^[A-Z_]+\\.md$'] }], // README.md, CHANGELOG.md, CLAUDE.md... are uppercase by convention
370
+ },
371
+ },
372
+
348
373
  // TOML files configuration
349
374
  {
350
375
  files: ['**/*.toml'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-angular-strict",
3
- "version": "22.6.3",
3
+ "version": "22.6.4",
4
4
  "description": "Modern ESLint configuration with strict rules for Angular development.",
5
5
  "keywords": [
6
6
  "angular",
@@ -39,6 +39,8 @@
39
39
  "@angular-eslint/eslint-plugin": "22.6.0",
40
40
  "@angular-eslint/eslint-plugin-template": "22.6.0",
41
41
  "@angular-eslint/template-parser": "22.6.0",
42
+ "@eslint/json": "2.1.1",
43
+ "@eslint/markdown": "8.0.3",
42
44
  "@stylistic/eslint-plugin": "5.10.0",
43
45
  "@typescript-eslint/eslint-plugin": "8.71.1",
44
46
  "@typescript-eslint/parser": "8.71.1",