linter-bundle 3.9.0 → 3.10.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/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/v3.9.0...HEAD)
9
+ [Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v3.10.0...HEAD)
10
+
11
+ ## [3.10.0] - 2023-08-29
12
+
13
+ ### Changed
14
+
15
+ - [eslint] Updated `@typescript-eslint` from `6.4.1` to `6.5.0`
16
+
17
+ ### Fixed
18
+
19
+ - [eslint] Don't consider files outside of `basePath` in [`restricted-filenames`](./eslint/rules/restricted-filenames.md) rule
20
+
21
+ [Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v3.9.0...v3.10.0)
10
22
 
11
23
  ## [3.9.0] - 2023-08-28
12
24
 
@@ -46,52 +46,58 @@ module.exports = {
46
46
  ]
47
47
  }
48
48
  },
49
- create: (context) => ({
50
- Program: (node) => {
51
- const filePath = context.getFilename();
52
- /** @type {{ basePath: string, allowed?: string[]; disallowed?: string[]; }[]} */
53
- const options = context.options;
49
+ create: (context) => {
50
+ const filePath = context.getFilename();
51
+ /** @type {{ basePath: string, allowed?: string[]; disallowed?: string[]; }[]} */
52
+ const options = context.options;
54
53
 
55
- for (const { basePath, allowed, disallowed } of options) {
56
- const normalizedName = path.relative(path.join(process.cwd(), basePath), filePath);
54
+ for (const { basePath, allowed, disallowed } of options) {
55
+ const normalizedName = path.relative(path.join(process.cwd(), basePath), filePath);
57
56
 
58
- if (allowed && !disallowed) {
59
- if (!micromatch.isMatch(normalizedName, allowed, { dot: true })) {
60
- report();
61
- return;
62
- }
57
+ if (normalizedName.startsWith('..')) {
58
+ continue;
59
+ }
60
+
61
+ if (allowed && !disallowed) {
62
+ if (!micromatch.isMatch(normalizedName, allowed, { dot: true })) {
63
+ return report();
63
64
  }
64
- else if (!allowed && disallowed) {
65
- if (micromatch.isMatch(normalizedName, disallowed, { dot: true })) {
66
- report();
67
- return;
68
- }
65
+ }
66
+ else if (!allowed && disallowed) {
67
+ if (micromatch.isMatch(normalizedName, disallowed, { dot: true })) {
68
+ return report();
69
69
  }
70
- else if (allowed && disallowed) {
71
- if (
72
- micromatch.isMatch(normalizedName, disallowed, { dot: true }) ||
73
- !micromatch.isMatch(normalizedName, allowed, { dot: true })
74
- ) {
75
- report();
76
- return;
77
- }
70
+ }
71
+ else if (allowed && disallowed) {
72
+ if (
73
+ micromatch.isMatch(normalizedName, disallowed, { dot: true }) ||
74
+ !micromatch.isMatch(normalizedName, allowed, { dot: true })
75
+ ) {
76
+ return report();
78
77
  }
79
78
  }
79
+ }
80
80
 
81
- /**
82
- * Reports to ESLint.
83
- *
84
- * @returns {void}
85
- */
86
- function report () {
87
- context.report({
88
- node,
89
- messageId: 'text',
90
- data: {
91
- name: path.relative(process.cwd(), filePath).replace(/\\/gu, '/')
92
- }
93
- });
94
- }
81
+ return {};
82
+
83
+ /**
84
+ * Add rule listener which reports the error.
85
+ *
86
+ * @returns {import('eslint').Rule.RuleListener} Returns a `Program` rule lister which reports the error.
87
+ */
88
+ function report () {
89
+ return {
90
+ Program: (node) => {
91
+ context.report({
92
+ node,
93
+ loc: { line: 1, column: 0 },
94
+ messageId: 'text',
95
+ data: {
96
+ name: path.relative(process.cwd(), filePath).replace(/\\/gu, '/')
97
+ }
98
+ });
99
+ }
100
+ };
95
101
  }
96
- })
102
+ }
97
103
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linter-bundle",
3
- "version": "3.9.0",
3
+ "version": "3.10.0",
4
4
  "description": "Ready-to use bundle of linting tools, containing configurations for ESLint, stylelint and markdownlint.",
5
5
  "keywords": [
6
6
  "eslint",
@@ -40,9 +40,9 @@
40
40
  "_validate-stylelint-options": "node ./validate-stylelint-options.mjs"
41
41
  },
42
42
  "dependencies": {
43
- "@typescript-eslint/eslint-plugin": "6.4.1",
44
- "@typescript-eslint/parser": "6.4.1",
45
- "@typescript-eslint/utils": "6.4.1",
43
+ "@typescript-eslint/eslint-plugin": "6.5.0",
44
+ "@typescript-eslint/parser": "6.5.0",
45
+ "@typescript-eslint/utils": "6.5.0",
46
46
  "eslint": "8.48.0",
47
47
  "eslint-import-resolver-typescript": "3.6.0",
48
48
  "eslint-import-resolver-webpack": "0.13.7",