@1stg/eslint-config 12.1.0 → 12.2.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
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 12.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#459](https://github.com/1stG/configs/pull/459) [`dce17c6`](https://github.com/1stG/configs/commit/dce17c6d530c40e09bc507978b70e6af2daf543f) Thanks [@JounQin](https://github.com/JounQin)! - Allow callers to append their own flat configs with the new `configs` option.
8
+
3
9
  ## 12.1.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -61,6 +61,7 @@ Use `defineConfig` only when you need options.
61
61
  | `code` | installed `typescript-eslint` | Lint JS/TS/JSX with rules Oxlint does not cover. |
62
62
  | `markup` | auto | Lint HTML with `eslint-plugin-markup` on Node >= 24 when installed. |
63
63
  | `ignores` | `[]` | Extra ignore patterns. |
64
+ | `configs` | `[]` | Extra flat configs appended last, after generated presets. |
64
65
 
65
66
  ## Sponsors and Backers
66
67
 
package/lib/index.d.ts CHANGED
@@ -17,6 +17,8 @@ export interface EslintConfigOptions {
17
17
  code?: boolean;
18
18
  /** Extra ignore patterns. */
19
19
  ignores?: string[];
20
+ /** Extra configs appended last, after the generated presets. */
21
+ configs?: Linter.Config | Linter.Config[];
20
22
  }
21
23
  /**
22
24
  * Build the flat ESLint config for the file types Oxlint does not parse.
@@ -24,6 +26,6 @@ export interface EslintConfigOptions {
24
26
  * Every plugin is imported dynamically (and only when its option is enabled), so the config works
25
27
  * with ESM-only plugins. ESLint awaits the returned promise before linting.
26
28
  */
27
- export declare const defineConfig: ({ markdown, jsonc: jsoncEnabled, yaml, toml: tomlEnabled, code, markup, ignores, }?: EslintConfigOptions) => Promise<Linter.Config[]>;
29
+ export declare const defineConfig: ({ markdown, jsonc: jsoncEnabled, yaml, toml: tomlEnabled, code, markup, ignores, configs: extraConfigs, }?: EslintConfigOptions) => Promise<Linter.Config[]>;
28
30
  declare const config: Promise<Linter.Config[]>;
29
31
  export default config;
package/lib/index.js CHANGED
@@ -79,7 +79,7 @@ const buildUnicornConfigs = () => __awaiter(void 0, void 0, void 0, function* ()
79
79
  * Every plugin is imported dynamically (and only when its option is enabled), so the config works
80
80
  * with ESM-only plugins. ESLint awaits the returned promise before linting.
81
81
  */
82
- export const defineConfig = (...args_1) => __awaiter(void 0, [...args_1], void 0, function* ({ markdown = true, jsonc: jsoncEnabled = true, yaml = isInstalled('eslint-plugin-yml'), toml: tomlEnabled = isInstalled('eslint-plugin-toml'), code = isInstalled('typescript-eslint'), markup = supportsMarkup && isInstalled('eslint-plugin-markup'), ignores = [], } = {}) {
82
+ export const defineConfig = (...args_1) => __awaiter(void 0, [...args_1], void 0, function* ({ markdown = true, jsonc: jsoncEnabled = true, yaml = isInstalled('eslint-plugin-yml'), toml: tomlEnabled = isInstalled('eslint-plugin-toml'), code = isInstalled('typescript-eslint'), markup = supportsMarkup && isInstalled('eslint-plugin-markup'), ignores = [], configs: extraConfigs = [], } = {}) {
83
83
  const defaultIgnores = DEFAULT_IGNORES.filter(pattern => (!markup || pattern !== '**/*.html') && (!code || pattern !== CODE_IGNORES));
84
84
  const configs = [{ ignores: [...defaultIgnores, ...ignores] }];
85
85
  if (markup) {
@@ -123,6 +123,7 @@ export const defineConfig = (...args_1) => __awaiter(void 0, [...args_1], void 0
123
123
  const toml = yield load('eslint-plugin-toml');
124
124
  configs.push(...toConfigs(toml.configs['flat/recommended']));
125
125
  }
126
+ configs.push(...toConfigs(extraConfigs));
126
127
  return configs;
127
128
  });
128
129
  // oxlint-disable-next-line unicorn/prefer-top-level-await -- keep the Promise API for ESLint
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1stg/eslint-config",
3
- "version": "12.1.0",
3
+ "version": "12.2.0",
4
4
  "type": "module",
5
5
  "description": "Personal but Shareable ESLint Configuration for the files Oxlint cannot lint",
6
6
  "repository": "git+https://github.com/1stG/configs.git",