@w5s/eslint-config 3.7.3 → 3.8.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/dist/index.js CHANGED
@@ -48,14 +48,14 @@ const tsSourceGlob = `**/${Project.extensionsToGlob(Project.queryExtensions(["ty
48
48
  const ymlSourceGlob = `**/${Project.extensionsToGlob(Project.queryExtensions(["yaml"]))}`;
49
49
  //#endregion
50
50
  //#region src/config/e18e.ts
51
- const defaultFiles$9 = [sourceGlob$1];
51
+ const defaultFiles$10 = [sourceGlob$1];
52
52
  /**
53
53
  * @see https://e18e.dev
54
54
  * @param options
55
55
  */
56
56
  async function e18e(options = {}) {
57
57
  const [e18ePlugin] = await Promise.all([interopDefault(import("@e18e/eslint-plugin"))]);
58
- const { files = defaultFiles$9, rules = {}, stylistic = true, modernization = true, moduleReplacements = false, performanceImprovements = true } = options;
58
+ const { files = defaultFiles$10, rules = {}, stylistic = true, modernization = true, moduleReplacements = false, performanceImprovements = true } = options;
59
59
  const { enabled: stylisticEnabled } = StylisticConfig.from(stylistic);
60
60
  return [{
61
61
  name: "w5s/e18e/setup",
@@ -482,7 +482,7 @@ const esRules = () => ({
482
482
  });
483
483
  //#endregion
484
484
  //#region src/config/es.ts
485
- const defaultFiles$8 = [esSourceGlob];
485
+ const defaultFiles$9 = [esSourceGlob];
486
486
  async function es(options) {
487
487
  const { recommended = true, rules = {} } = options;
488
488
  return [{
@@ -510,7 +510,7 @@ async function es(options) {
510
510
  linterOptions: { reportUnusedDisableDirectives: true }
511
511
  }, {
512
512
  name: "w5s/es/rules",
513
- files: defaultFiles$8,
513
+ files: defaultFiles$9,
514
514
  rules: {
515
515
  ...recommended ? es["recommended"] : {},
516
516
  ...rules
@@ -531,10 +531,10 @@ async function ignores(options = {}) {
531
531
  }
532
532
  //#endregion
533
533
  //#region src/config/jsdoc.ts
534
- const defaultFiles$7 = [sourceGlob$1];
534
+ const defaultFiles$8 = [sourceGlob$1];
535
535
  async function jsdoc(options = {}) {
536
536
  const [jsdocPlugin] = await Promise.all([interopDefault(import("eslint-plugin-jsdoc"))]);
537
- const { files = defaultFiles$7, recommended = true, rules = {}, stylistic = true } = options;
537
+ const { files = defaultFiles$8, recommended = true, rules = {}, stylistic = true } = options;
538
538
  const { enabled: stylisticEnabled } = StylisticConfig.from(stylistic);
539
539
  return [{
540
540
  name: "w5s/jsdoc/setup",
@@ -570,10 +570,10 @@ async function jsdoc(options = {}) {
570
570
  }
571
571
  //#endregion
572
572
  //#region src/config/jsonc.ts
573
- const defaultFiles$6 = [jsonSourceGlob];
573
+ const defaultFiles$7 = [jsonSourceGlob];
574
574
  async function jsonc(options = {}) {
575
575
  const [jsoncPlugin, jsoncParser] = await Promise.all([interopDefault(import("eslint-plugin-jsonc")), interopDefault(import("jsonc-eslint-parser"))]);
576
- const { files = defaultFiles$6, recommended = true, rules = {}, stylistic = true } = options;
576
+ const { files = defaultFiles$7, recommended = true, rules = {}, stylistic = true } = options;
577
577
  const { enabled: stylisticEnabled, indent } = StylisticConfig.from(stylistic);
578
578
  return [
579
579
  {
@@ -838,10 +838,10 @@ imports["recommended"] = {
838
838
  imports["stylistic"] = { "import/newline-after-import": ["error", { count: 1 }] };
839
839
  //#endregion
840
840
  //#region src/config/markdown.ts
841
- const defaultFiles$5 = [`**/${Project.extensionsToGlob(Project.queryExtensions(["markdown"]))}`];
841
+ const defaultFiles$6 = [`**/${Project.extensionsToGlob(Project.queryExtensions(["markdown"]))}`];
842
842
  async function markdown(options = {}) {
843
843
  const [markdownPlugin] = await Promise.all([interopDefault(import("@eslint/markdown"))]);
844
- const { language = "markdown/gfm", files = defaultFiles$5, recommended = true, rules = {}, stylistic = true } = options;
844
+ const { language = "markdown/gfm", files = defaultFiles$6, recommended = true, rules = {}, stylistic = true } = options;
845
845
  const { enabled: stylisticEnabled } = StylisticConfig.from(stylistic);
846
846
  return [{
847
847
  name: "w5s/markdown/setup",
@@ -860,10 +860,10 @@ async function markdown(options = {}) {
860
860
  }
861
861
  //#endregion
862
862
  //#region src/config/next.ts
863
- const defaultFiles$4 = [sourceGlob$1];
863
+ const defaultFiles$5 = [sourceGlob$1];
864
864
  async function next(options = {}) {
865
865
  const [nextPlugin] = await Promise.all([interopDefault(import("@next/eslint-plugin-next"))]);
866
- const { files = defaultFiles$4, recommended = true, rules = {} } = options;
866
+ const { files = defaultFiles$5, recommended = true, rules = {} } = options;
867
867
  return [{
868
868
  name: "w5s/next/setup",
869
869
  plugins: { next: nextPlugin }
@@ -909,6 +909,28 @@ async function node(options = {}) {
909
909
  }];
910
910
  }
911
911
  //#endregion
912
+ //#region src/config/react.ts
913
+ const defaultFiles$4 = [sourceGlob$1];
914
+ async function react(options = {}) {
915
+ const [reactPlugin] = await Promise.all([interopDefault(import("@eslint-react/eslint-plugin"))]);
916
+ const { files = defaultFiles$4, recommended, rules = {} } = options;
917
+ return [{
918
+ name: "w5s/react/setup",
919
+ plugins: { react: reactPlugin }
920
+ }, {
921
+ name: "w5s/react/rules",
922
+ files,
923
+ languageOptions: {
924
+ parserOptions: { ecmaFeatures: { jsx: true } },
925
+ sourceType: "module"
926
+ },
927
+ rules: {
928
+ ...recommended ? reactPlugin.configs["recommended"].rules : {},
929
+ ...rules
930
+ }
931
+ }];
932
+ }
933
+ //#endregion
912
934
  //#region src/config/stylistic.ts
913
935
  async function stylistic(options = {}) {
914
936
  const [stylisticPlugin] = await Promise.all([interopDefault(import("@stylistic/eslint-plugin"))]);
@@ -1192,16 +1214,16 @@ async function defineConfig(options = {}) {
1192
1214
  ...optionsOrBoolean
1193
1215
  });
1194
1216
  const includeEnabled = (factory, input) => input.enabled ? [factory(input)] : [];
1195
- return ESLintConfig.concat(...includeEnabled(e18e, toOption(options.e18e)), ...includeEnabled(es, toOption(options.es)), ...includeEnabled(ts, toOption(options.ts)), ...includeEnabled(ignores, toOption(options)), ...includeEnabled(jsonc, toOption(options.jsonc)), ...includeEnabled(jsdoc, toOption(options.jsdoc)), ...includeEnabled(stylistic, toOption(options.stylistic)), ...includeEnabled(imports, toOption(options.import)), ...includeEnabled(markdown, toOption(options.markdown)), ...includeEnabled(next, toOption(options.next)), ...includeEnabled(node, toOption(options.node)), ...includeEnabled(unicorn, toOption(options.unicorn)), ...includeEnabled(yml, toOption(options.yml)), ...includeEnabled(test, toOption(options.test)));
1217
+ return ESLintConfig.concat(...includeEnabled(e18e, toOption(options.e18e)), ...includeEnabled(es, toOption(options.es)), ...includeEnabled(ts, toOption(options.ts)), ...includeEnabled(ignores, toOption(options)), ...includeEnabled(jsonc, toOption(options.jsonc)), ...includeEnabled(jsdoc, toOption(options.jsdoc)), ...includeEnabled(react, toOption(options.react)), ...includeEnabled(stylistic, toOption(options.stylistic)), ...includeEnabled(imports, toOption(options.import)), ...includeEnabled(markdown, toOption(options.markdown)), ...includeEnabled(next, toOption(options.next)), ...includeEnabled(node, toOption(options.node)), ...includeEnabled(unicorn, toOption(options.unicorn)), ...includeEnabled(yml, toOption(options.yml)), ...includeEnabled(test, toOption(options.test)));
1196
1218
  }
1197
1219
  //#endregion
1198
1220
  //#region src/meta.ts
1199
1221
  const meta = Object.freeze({
1200
1222
  name: "@w5s/eslint-config",
1201
- version: "3.7.3",
1223
+ version: "3.8.0",
1202
1224
  buildNumber: 1
1203
1225
  });
1204
1226
  //#endregion
1205
- export { StylisticConfig, defineConfig as default, defineConfig, e18e, es, ignores, imports, jsdoc, jsonc, markdown, meta, next, node, stylistic, test, ts, unicorn, yml };
1227
+ export { StylisticConfig, defineConfig as default, defineConfig, e18e, es, ignores, imports, jsdoc, jsonc, markdown, meta, next, node, react, stylistic, test, ts, unicorn, yml };
1206
1228
 
1207
1229
  //# sourceMappingURL=index.js.map