@kazupon/eslint-config 0.39.1 → 0.40.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/README.md CHANGED
@@ -147,7 +147,7 @@ The following built-in preset configurations are supported:
147
147
  | `css` | [`@eslint/css`](https://www.npmjs.com/package/@eslint/css) | yes |
148
148
  | `html` | [`@html-eslint/eslint-plugin`](https://www.npmjs.com/package/@html-eslint/eslint-plugin) | yes |
149
149
  | `deps` | [`eslint-plugin-barrel-files`](https://www.npmjs.com/package/eslint-plugin-barrel-files) | yes |
150
- | `oxclint` | [`eslint-plugin-oxlint`](https://www.npmjs.com/package/eslint-plugin-oxlint) | yes |
150
+ | `oxlint` | [`eslint-plugin-oxlint`](https://www.npmjs.com/package/eslint-plugin-oxlint) | yes |
151
151
 
152
152
  You can use `import` syntax:
153
153
 
package/dist/index.d.mts CHANGED
@@ -16712,6 +16712,18 @@ interface OxlintOptions {
16712
16712
  * enable nursery rules
16713
16713
  */
16714
16714
  withNursery?: boolean;
16715
+ /**
16716
+ * enable global ignore patterns
16717
+ *
16718
+ * if true, it will use oxlint configure `ignorePatterns` as global ignore for ESLint flat config
16719
+ *
16720
+ * if the below PR released, this option will be removed and enabled by default
16721
+ *
16722
+ * @see https://github.com/oxc-project/eslint-plugin-oxlint/pull/564
16723
+ *
16724
+ * @default false
16725
+ */
16726
+ enableGlobalIgnore?: boolean;
16715
16727
  }
16716
16728
  /**
16717
16729
  * `eslint-plugin-oxlint` and overrides configuration options
package/dist/index.mjs CHANGED
@@ -714,12 +714,29 @@ const md = markdown;
714
714
  */
715
715
  async function oxlint(options = {}) {
716
716
  const { rules: overrideRules = {} } = options;
717
+ const enableGlobalIgnore = options.enableGlobalIgnore ?? false;
717
718
  const oxlint$1 = await loadPlugin("eslint-plugin-oxlint");
718
719
  const customConfig = {
719
720
  name: "@kazupon/oxlint",
720
721
  rules: { ...overrideRules }
721
722
  };
722
- return [...options.configFile ? oxlint$1.buildFromOxlintConfigFile(options.configFile, { withNursery: options.withNursery }) : oxlint$1.configs["flat/all"], customConfig];
723
+ if (options.configFile) {
724
+ const configsFromFile = oxlint$1.buildFromOxlintConfigFile(options.configFile, { withNursery: options.withNursery });
725
+ const oxlintBaseConfig = configsFromFile.find((config) => config.name === "oxlint/from-oxlint-config");
726
+ let ignores = void 0;
727
+ if (oxlintBaseConfig && enableGlobalIgnore && oxlintBaseConfig.ignores) {
728
+ ignores = oxlintBaseConfig.ignores;
729
+ delete oxlintBaseConfig.ignores;
730
+ }
731
+ return enableGlobalIgnore && ignores ? [
732
+ {
733
+ name: "@kazupon/oxlint-global-ignore",
734
+ ignores
735
+ },
736
+ ...configsFromFile,
737
+ customConfig
738
+ ] : [...configsFromFile, customConfig];
739
+ } else return [...oxlint$1.configs["flat/all"], customConfig];
723
740
  }
724
741
 
725
742
  //#endregion
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kazupon/eslint-config",
3
3
  "description": "ESLint config for @kazupon",
4
- "version": "0.39.1",
4
+ "version": "0.40.0",
5
5
  "author": {
6
6
  "email": "kawakazu80@gmail.com",
7
7
  "name": "kazuya kawaguchi"