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

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 +28 -1
  3. package/package.json +4 -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 โ€” files ignored by git are skipped:
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
@@ -2,7 +2,10 @@ import { configs, rules } from 'eslint-config-airbnb-extended';
2
2
  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
+ import gitignore from 'eslint-config-flat-gitignore';
5
6
  import importXPlugin from 'eslint-plugin-import-x';
7
+ import jsonPlugin from '@eslint/json';
8
+ import markdownPlugin from '@eslint/markdown';
6
9
  import perfectionistPlugin from 'eslint-plugin-perfectionist';
7
10
  import stylistic from '@stylistic/eslint-plugin';
8
11
  import tomlPlugin from 'eslint-plugin-toml';
@@ -19,10 +22,12 @@ const enableAllRules = (plugin, prefix) => Object.fromEntries(Object.keys(plugin
19
22
  // The language plugins ship their presets as arrays whose rules carry no `files` โ€” merge them so they stay scoped to our own blocks
20
23
  const presetRules = preset => Object.assign({}, ...preset.map(config => config.rules));
21
24
 
22
- const dataFiles = ['**/*.toml', '**/*.yaml', '**/*.yml']; // Data files get their own language blocks below: the JavaScript presets must not reach them
25
+ // Data files get their own language blocks below: the JavaScript presets must not reach them
26
+ const dataFiles = ['**/*.json', '**/*.json5', '**/*.jsonc', '**/*.md', '**/*.toml', '**/*.yaml', '**/*.yml'];
23
27
 
24
28
  export default [
25
29
  { ignores: ['dist/**', 'node_modules/**'] }, // Alone in its object, `ignores` is global: mixed with other keys it only applies to that block
30
+ gitignore({ strict: false }), // What git ignores is not linted either: the nearest `.gitignore` is read from the working directory up, if there is one
26
31
 
27
32
  {
28
33
  plugins: {
@@ -345,6 +350,28 @@ export default [
345
350
  },
346
351
  },
347
352
 
353
+ // JSON files configuration
354
+ {
355
+ files: ['**/*.json', '**/*.json5', '**/*.jsonc'],
356
+ plugins: { json: jsonPlugin, unicorn: unicornPlugin },
357
+ rules: { ...jsonPlugin.configs.recommended.rules, ...unicornPlugin.configs['recommended-json'].rules },
358
+ },
359
+ { files: ['**/*.json'], language: 'json/json' },
360
+ { files: ['**/*.json5'], language: 'json/json5' },
361
+ { files: ['**/*.jsonc', '**/.vscode/*.json', '**/tsconfig*.json'], language: 'json/jsonc' }, // these tolerate comments, and this block wins over the `.json` one
362
+
363
+ // Markdown files configuration
364
+ {
365
+ files: ['**/*.md'],
366
+ language: 'markdown/gfm',
367
+ plugins: { markdown: markdownPlugin, unicorn: unicornPlugin },
368
+ rules: {
369
+ ...presetRules(markdownPlugin.configs.recommended),
370
+ ...unicornPlugin.configs['recommended-markdown'].rules,
371
+ 'unicorn/filename-case': ['error', { ignore: ['^[A-Z_]+\\.md$'] }], // README.md, CHANGELOG.md, CLAUDE.md... are uppercase by convention
372
+ },
373
+ },
374
+
348
375
  // TOML files configuration
349
376
  {
350
377
  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.5",
4
4
  "description": "Modern ESLint configuration with strict rules for Angular development.",
5
5
  "keywords": [
6
6
  "angular",
@@ -39,11 +39,14 @@
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",
45
47
  "eslint": "10.12.0",
46
48
  "eslint-config-airbnb-extended": "3.3.0",
49
+ "eslint-config-flat-gitignore": "2.4.0",
47
50
  "eslint-plugin-import-x": "4.17.1",
48
51
  "eslint-plugin-perfectionist": "5.12.1",
49
52
  "eslint-plugin-toml": "1.5.0",