linter-bundle 5.0.1 → 5.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/.linter-bundle.js CHANGED
@@ -9,6 +9,7 @@ const snippets = {
9
9
  };
10
10
 
11
11
  export default {
12
+ timing: true,
12
13
  files: {
13
14
  restrictions: [
14
15
  {
@@ -31,6 +32,7 @@ export default {
31
32
  '.gitattributes',
32
33
  '.gitignore',
33
34
  '.linter-bundle.js',
35
+ '.linter-bundle.schema.json',
34
36
  '.markdownlint.json',
35
37
  '.npmignore',
36
38
  '*.md',
@@ -0,0 +1,125 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "verbose": {
6
+ "type": "boolean"
7
+ },
8
+ "timing": {
9
+ "type": "boolean"
10
+ },
11
+ "git": {
12
+ "type": "boolean"
13
+ },
14
+ "files": {
15
+ "type": "object",
16
+ "properties": {
17
+ "restrictions": {
18
+ "type": "array",
19
+ "items": {
20
+ "type": "object",
21
+ "properties": {
22
+ "basePath": {
23
+ "type": "string"
24
+ },
25
+ "allowed": {
26
+ "type": "array",
27
+ "items": {
28
+ "type": "string"
29
+ }
30
+ },
31
+ "disallowed": {
32
+ "type": "array",
33
+ "items": {
34
+ "type": "string"
35
+ }
36
+ }
37
+ },
38
+ "required": [
39
+ "restrictions"
40
+ ],
41
+ "additionalProperties": false
42
+ }
43
+ }
44
+ },
45
+ "required": [
46
+ "restrictions"
47
+ ],
48
+ "additionalProperties": false
49
+ },
50
+ "tsc": {
51
+ "type": "object",
52
+ "properties": {
53
+ "tsconfig": {
54
+ "type": "string"
55
+ }
56
+ },
57
+ "additionalProperties": false
58
+ },
59
+ "ts": {
60
+ "type": "object",
61
+ "properties": {
62
+ "tsconfig": {
63
+ "type": "string"
64
+ },
65
+ "include": {
66
+ "type": "array",
67
+ "items": {
68
+ "type": "string"
69
+ }
70
+ },
71
+ "exclude": {
72
+ "type": "array",
73
+ "items": {
74
+ "type": "string"
75
+ }
76
+ },
77
+ "overrides": {
78
+ "type": "object",
79
+ "properties": {
80
+ "general": {
81
+ "type": "object"
82
+ },
83
+ "react": {
84
+ "type": "object"
85
+ }
86
+ },
87
+ "additionalProperties": false
88
+ }
89
+ },
90
+ "additionalProperties": false
91
+ },
92
+ "sass": {
93
+ "type": "object",
94
+ "properties": {
95
+ "patternPrefix": {
96
+ "type": "string"
97
+ }
98
+ },
99
+ "additionalProperties": false
100
+ },
101
+ "audit": {
102
+ "type": "object",
103
+ "properties": {
104
+ "minSeverity": {
105
+ "type": "string",
106
+ "enum": [
107
+ "info",
108
+ "low",
109
+ "moderate",
110
+ "high",
111
+ "critical"
112
+ ]
113
+ },
114
+ "exclude": {
115
+ "type": "array",
116
+ "items": {
117
+ "type": "string"
118
+ }
119
+ }
120
+ },
121
+ "additionalProperties": false
122
+ }
123
+ },
124
+ "additionalProperties": false
125
+ }
package/CHANGELOG.md CHANGED
@@ -6,7 +6,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
- [Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v5.0.1...HEAD)
9
+ [Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v5.1.0...HEAD)
10
+
11
+ ## [5.1.0] - 2023-09-03
12
+
13
+ ### Added
14
+
15
+ - [general] Added basic schema for `.linter-bundle.json` configuration file
16
+
17
+ ### Fixed
18
+
19
+ - [general] Fix support for `.linter-bundle.json`
20
+
21
+ [Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v5.0.1...v5.1.0)
10
22
 
11
23
  ## [5.0.1] - 2023-09-03
12
24
 
@@ -37,7 +49,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
37
49
 
38
50
  ## [4.0.3] - 2023-08-31
39
51
 
40
- ### Changed
52
+ ### Fixed
41
53
 
42
54
  - [files] Don't show "No relevant files changed." if the `--git`` option was not used
43
55
 
@@ -45,7 +57,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
45
57
 
46
58
  ## [4.0.2] - 2023-08-31
47
59
 
48
- ### Changed
60
+ ### Fixed
49
61
 
50
62
  - [files] Don't append `"**"` as fallback argument to the command line
51
63
 
@@ -56,6 +68,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
56
68
  ### Changed
57
69
 
58
70
  - [eslint] Disabled `unicorn/filename-case` in favour of the new linter-bundle `files` task
71
+
72
+ ### Fixed
73
+
59
74
  - [files] Fixed path to `files` task
60
75
 
61
76
  [Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v4.0.0...v4.0.1)
package/TODO.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # @todo
2
2
 
3
+ - Timing funktioniert nicht - siehe HexEd.it-core
4
+
5
+ - Wie erreichen wir auto-completion in der .linter-bundle.js datei?
6
+ .linter-bundle.json vielleicht mit Schema-Datei?
7
+
3
8
  <!-- markdownlint-disable -->
4
9
 
5
10
  - Bereiche in Readme aufklappbar machen:
@@ -6,6 +6,13 @@ export interface LinterBundleConfig {
6
6
  verbose?: boolean;
7
7
  timing?: boolean;
8
8
  git?: boolean;
9
+ files?: {
10
+ restrictions: {
11
+ basePath: string;
12
+ allowed?: string[];
13
+ disallowed?: string[];
14
+ }[];
15
+ };
9
16
  tsc?: {
10
17
  tsconfig?: string;
11
18
  };
@@ -34,13 +41,6 @@ export interface LinterBundleConfig {
34
41
  minSeverity?: 'info' | 'low' | 'moderate' | 'high' | 'critical';
35
42
  exclude?: string[];
36
43
  };
37
- files?: {
38
- restrictions: {
39
- basePath: string;
40
- allowed?: string[];
41
- disallowed?: string[];
42
- }[];
43
- };
44
44
  }
45
45
 
46
46
  export const linterBundleConfig: LinterBundleConfig;
@@ -2,6 +2,7 @@
2
2
  * @file Returns the `.linter-bundle.js` configuration result.
3
3
  */
4
4
 
5
+ import * as fs from 'node:fs/promises';
5
6
  import * as path from 'node:path';
6
7
 
7
8
  export const linterBundleConfig = (
@@ -19,9 +20,15 @@ export const linterBundleConfig = (
19
20
  * @returns {Promise<import('./linter-bundle-config.js').LinterBundleConfig | undefined>} - Either the file content for `undefined` if the file does not exist.
20
21
  * */
21
22
  async function loadConfig (fileName) {
22
- const filePath = path.join('file://', process.cwd(), fileName);
23
-
24
23
  try {
24
+ if (fileName.endsWith('.json')) {
25
+ const content = await fs.readFile(path.join(process.cwd(), fileName), 'utf8');
26
+
27
+ return JSON.parse(content);
28
+ }
29
+
30
+ const filePath = path.join('file://', process.cwd(), fileName);
31
+
25
32
  const config = await import(filePath);
26
33
 
27
34
  if ('default' in config) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linter-bundle",
3
- "version": "5.0.1",
3
+ "version": "5.1.0",
4
4
  "type": "module",
5
5
  "description": "Ready-to use bundle of linting tools, containing configurations for ESLint, stylelint and markdownlint.",
6
6
  "keywords": [