@w5s/eslint-config 2.0.4 → 2.0.6

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.
@@ -26,10 +26,12 @@ const config = dev_1.ESLintConfig.concat(imports_1.default,
26
26
  ...imports_1.default.rules['import/no-extraneous-dependencies'][1],
27
27
  devDependencies: [
28
28
  ...imports_1.default.rules['import/no-extraneous-dependencies'][1].devDependencies,
29
- 'plopfile.[jt]s',
30
- 'dangerfile.[jt]s',
31
- '**/*.config.[jt]s?(x)',
32
- '**/*.config.cjs',
29
+ // plopfile.js, plopfile.cjs, plopfile.mts, plopfile.ts, ...
30
+ ...dev_1.Project.queryExtensions(['javascript', 'typescript']).map((extension) => `plopfile${extension}`),
31
+ // dangerfile.js, dangerfile.cjs, dangerfile.mts, dangerfile.ts, ...
32
+ ...dev_1.Project.queryExtensions(['javascript', 'typescript']).map((extension) => `dangerfile${extension}`),
33
+ // *.config.js, *.config.cjs, *.config.mts, *.config.ts, ...
34
+ ...dev_1.Project.queryExtensions(['javascript', 'typescript']).map((extension) => `*.config${extension}`),
33
35
  ],
34
36
  },
35
37
  ],
package/dist/rules/yml.js CHANGED
@@ -1,6 +1,20 @@
1
1
  "use strict";
2
+ const dev_1 = require("@w5s/dev");
3
+ const yamlExtensions = dev_1.Project.queryExtensions(['yaml']);
2
4
  const config = {
3
5
  extends: ['plugin:yml/standard', 'plugin:yml/prettier'],
6
+ overrides: [
7
+ {
8
+ files: [
9
+ ...yamlExtensions.map((ext) => `docker-compose*${ext}`),
10
+ ...yamlExtensions.map((ext) => `compose-*${ext}`),
11
+ ...yamlExtensions.map((ext) => `compose${ext}`),
12
+ ],
13
+ rules: {
14
+ 'yml/no-empty-mapping-value': 'off',
15
+ },
16
+ },
17
+ ],
4
18
  parser: 'yaml-eslint-parser',
5
19
  plugins: ['yml'],
6
20
  };
package/dist/yml.js CHANGED
@@ -2,12 +2,17 @@
2
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
+ const dev_1 = require("@w5s/dev");
5
6
  const yml_js_1 = __importDefault(require("./rules/yml.js"));
6
7
  const config = {
7
8
  overrides: [
8
9
  {
9
10
  ...yml_js_1.default,
10
- files: ['*.yml', '*.yaml'],
11
+ files: [
12
+ dev_1.Project.extensionsToGlob(
13
+ // ts only extensions
14
+ dev_1.Project.queryExtensions(['yaml'])),
15
+ ],
11
16
  },
12
17
  ],
13
18
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w5s/eslint-config",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "ESLint configuration presets",
5
5
  "keywords": [
6
6
  "eslint",
@@ -35,8 +35,8 @@
35
35
  "@rushstack/eslint-patch": "^1.1.0",
36
36
  "@typescript-eslint/eslint-plugin": "^6.0.0",
37
37
  "@typescript-eslint/parser": "^6.0.0",
38
- "@w5s/dev": "^2.0.4",
39
- "@w5s/prettier-config": "^2.0.2",
38
+ "@w5s/dev": "^2.0.6",
39
+ "@w5s/prettier-config": "^2.0.3",
40
40
  "eslint-config-airbnb-base": "^15.0.0",
41
41
  "eslint-config-prettier": "^9.0.0",
42
42
  "eslint-plugin-import": "^2.25.0",
@@ -69,5 +69,5 @@
69
69
  "publishConfig": {
70
70
  "access": "public"
71
71
  },
72
- "gitHead": "3b3fdc935f9a82009a8e7c0c7951ee2b4d8f7943"
72
+ "gitHead": "eafe8f4243aff7708647c9fccd4b6b86a4af2d16"
73
73
  }
@@ -26,10 +26,12 @@ const config: eslint.Linter.Config = ESLintConfig.concat(
26
26
  ...importConfig.rules['import/no-extraneous-dependencies'][1],
27
27
  devDependencies: [
28
28
  ...importConfig.rules['import/no-extraneous-dependencies'][1].devDependencies,
29
- 'plopfile.[jt]s',
30
- 'dangerfile.[jt]s',
31
- '**/*.config.[jt]s?(x)',
32
- '**/*.config.cjs',
29
+ // plopfile.js, plopfile.cjs, plopfile.mts, plopfile.ts, ...
30
+ ...Project.queryExtensions(['javascript', 'typescript']).map((extension) => `plopfile${extension}`),
31
+ // dangerfile.js, dangerfile.cjs, dangerfile.mts, dangerfile.ts, ...
32
+ ...Project.queryExtensions(['javascript', 'typescript']).map((extension) => `dangerfile${extension}`),
33
+ // *.config.js, *.config.cjs, *.config.mts, *.config.ts, ...
34
+ ...Project.queryExtensions(['javascript', 'typescript']).map((extension) => `*.config${extension}`),
33
35
  ],
34
36
  },
35
37
  ],
package/src/rules/yml.ts CHANGED
@@ -1,7 +1,21 @@
1
+ import { Project } from '@w5s/dev';
1
2
  import type eslint from 'eslint';
2
3
 
4
+ const yamlExtensions = Project.queryExtensions(['yaml']);
3
5
  const config: eslint.Linter.Config = {
4
6
  extends: ['plugin:yml/standard', 'plugin:yml/prettier'],
7
+ overrides: [
8
+ {
9
+ files: [
10
+ ...yamlExtensions.map((ext) => `docker-compose*${ext}`),
11
+ ...yamlExtensions.map((ext) => `compose-*${ext}`),
12
+ ...yamlExtensions.map((ext) => `compose${ext}`),
13
+ ],
14
+ rules: {
15
+ 'yml/no-empty-mapping-value': 'off',
16
+ },
17
+ },
18
+ ],
5
19
  parser: 'yaml-eslint-parser',
6
20
  plugins: ['yml'],
7
21
  };
package/src/yml.ts CHANGED
@@ -1,11 +1,17 @@
1
1
  import type eslint from 'eslint';
2
+ import { Project } from '@w5s/dev';
2
3
  import ymlConfig from './rules/yml.js';
3
4
 
4
5
  const config: eslint.Linter.Config = {
5
6
  overrides: [
6
7
  {
7
8
  ...ymlConfig,
8
- files: ['*.yml', '*.yaml'],
9
+ files: [
10
+ Project.extensionsToGlob(
11
+ // ts only extensions
12
+ Project.queryExtensions(['yaml'])
13
+ ),
14
+ ],
9
15
  },
10
16
  ],
11
17
  };