eslint-config-decent 2.0.0 → 2.0.2

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2019 James Geurts
3
+ Copyright (c) James Geurts
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -56,7 +56,19 @@ export default [
56
56
  rules: {
57
57
  '@typescript-eslint/no-confusing-void-expression': 'off',
58
58
  },
59
- }
59
+ },
60
+ ];
61
+ ```
62
+
63
+ ## Use typescript-eslint config
64
+
65
+ ```mjs
66
+ // eslint.config.mjs
67
+
68
+ import { tsEslintConfig } from 'eslint-config-decent';
69
+ import tsEslint from 'typescript-eslint';
70
+
71
+ export default tsEslint(...tsEslintConfig());
60
72
  ```
61
73
 
62
74
  ## License
package/dist/index.cjs CHANGED
@@ -11,6 +11,7 @@ const importPlugin = require('eslint-plugin-import-x');
11
11
  const jsdoc = require('eslint-plugin-jsdoc');
12
12
  const mocha = require('eslint-plugin-mocha');
13
13
  const promise = require('eslint-plugin-promise');
14
+ const compat = require('@eslint/compat');
14
15
  const a11y = require('eslint-plugin-jsx-a11y');
15
16
  const react = require('eslint-plugin-react');
16
17
  const reactHooks = require('eslint-plugin-react-hooks');
@@ -505,7 +506,7 @@ const base$3 = {
505
506
  "jsx-a11y": a11y__default,
506
507
  react: react__default,
507
508
  "react-hooks": reactHooks__default,
508
- "testing-library": testingLibrary__default
509
+ "testing-library": compat.fixupPluginRules(testingLibrary__default)
509
510
  },
510
511
  rules: {
511
512
  ...a11y__default.configs.recommended.rules,
@@ -671,7 +672,8 @@ const configs = {
671
672
  base
672
673
  };
673
674
 
674
- function defaultConfig(options) {
675
+ const defaultConfig = tsEslintConfig;
676
+ function tsEslintConfig(options) {
675
677
  const enableRequireExtensionRule = options?.enableRequireExtensionRule ?? true;
676
678
  const languageOptions = {
677
679
  globals: {
@@ -766,7 +768,7 @@ function defaultConfig(options) {
766
768
  ];
767
769
  }
768
770
  function config(options) {
769
- return tsEslint__default.config(...defaultConfig(options));
771
+ return tsEslint__default.config(...tsEslintConfig(options));
770
772
  }
771
773
 
772
774
  exports.config = config;
@@ -777,5 +779,6 @@ exports.jsdocConfigs = configs$6;
777
779
  exports.promiseConfigs = configs$4;
778
780
  exports.reactConfigs = configs$3;
779
781
  exports.securityConfigs = configs$2;
782
+ exports.tsEslintConfig = tsEslintConfig;
780
783
  exports.typescriptEslintConfigs = configs$1;
781
784
  exports.unicornConfigs = configs;
package/dist/index.d.cts CHANGED
@@ -39,12 +39,16 @@ interface DefaultConfigOptions {
39
39
  parserOptions?: NonNullable<ConfigWithExtends['languageOptions']>['parserOptions'];
40
40
  enableRequireExtensionRule?: boolean;
41
41
  }
42
+ /**
43
+ * @deprecated Use `tsEslintConfig` instead
44
+ */
45
+ declare const defaultConfig: typeof tsEslintConfig;
42
46
  /**
43
47
  * Exports the default configuration to be passed to `tsEslint.config`. Use this if you want more control of typescript-eslint configuration output.
44
48
  * @param {DefaultConfigOptions} options
45
49
  * @returns Array of typescript-eslint configurations
46
50
  */
47
- declare function defaultConfig(options?: DefaultConfigOptions): ConfigWithExtends[];
51
+ declare function tsEslintConfig(options?: DefaultConfigOptions): ConfigWithExtends[];
48
52
  /**
49
53
  * Exports eslint configurations. Use this if you do not need to explicitly import typescript-eslint in your project.
50
54
  * @param options
@@ -52,4 +56,4 @@ declare function defaultConfig(options?: DefaultConfigOptions): ConfigWithExtend
52
56
  */
53
57
  declare function config(options?: DefaultConfigOptions): TSESLint.FlatConfig.ConfigArray;
54
58
 
55
- export { type DefaultConfigOptions, config, defaultConfig, configs$7 as eslintConfigs, configs$6 as importConfigs, configs$5 as jsdocConfigs, configs$4 as promiseConfigs, configs$3 as reactConfigs, configs$2 as securityConfigs, configs$1 as typescriptEslintConfigs, configs as unicornConfigs };
59
+ export { type DefaultConfigOptions, config, defaultConfig, configs$7 as eslintConfigs, configs$6 as importConfigs, configs$5 as jsdocConfigs, configs$4 as promiseConfigs, configs$3 as reactConfigs, configs$2 as securityConfigs, tsEslintConfig, configs$1 as typescriptEslintConfigs, configs as unicornConfigs };
package/dist/index.d.mts CHANGED
@@ -39,12 +39,16 @@ interface DefaultConfigOptions {
39
39
  parserOptions?: NonNullable<ConfigWithExtends['languageOptions']>['parserOptions'];
40
40
  enableRequireExtensionRule?: boolean;
41
41
  }
42
+ /**
43
+ * @deprecated Use `tsEslintConfig` instead
44
+ */
45
+ declare const defaultConfig: typeof tsEslintConfig;
42
46
  /**
43
47
  * Exports the default configuration to be passed to `tsEslint.config`. Use this if you want more control of typescript-eslint configuration output.
44
48
  * @param {DefaultConfigOptions} options
45
49
  * @returns Array of typescript-eslint configurations
46
50
  */
47
- declare function defaultConfig(options?: DefaultConfigOptions): ConfigWithExtends[];
51
+ declare function tsEslintConfig(options?: DefaultConfigOptions): ConfigWithExtends[];
48
52
  /**
49
53
  * Exports eslint configurations. Use this if you do not need to explicitly import typescript-eslint in your project.
50
54
  * @param options
@@ -52,4 +56,4 @@ declare function defaultConfig(options?: DefaultConfigOptions): ConfigWithExtend
52
56
  */
53
57
  declare function config(options?: DefaultConfigOptions): TSESLint.FlatConfig.ConfigArray;
54
58
 
55
- export { type DefaultConfigOptions, config, defaultConfig, configs$7 as eslintConfigs, configs$6 as importConfigs, configs$5 as jsdocConfigs, configs$4 as promiseConfigs, configs$3 as reactConfigs, configs$2 as securityConfigs, configs$1 as typescriptEslintConfigs, configs as unicornConfigs };
59
+ export { type DefaultConfigOptions, config, defaultConfig, configs$7 as eslintConfigs, configs$6 as importConfigs, configs$5 as jsdocConfigs, configs$4 as promiseConfigs, configs$3 as reactConfigs, configs$2 as securityConfigs, tsEslintConfig, configs$1 as typescriptEslintConfigs, configs as unicornConfigs };
package/dist/index.d.ts CHANGED
@@ -39,12 +39,16 @@ interface DefaultConfigOptions {
39
39
  parserOptions?: NonNullable<ConfigWithExtends['languageOptions']>['parserOptions'];
40
40
  enableRequireExtensionRule?: boolean;
41
41
  }
42
+ /**
43
+ * @deprecated Use `tsEslintConfig` instead
44
+ */
45
+ declare const defaultConfig: typeof tsEslintConfig;
42
46
  /**
43
47
  * Exports the default configuration to be passed to `tsEslint.config`. Use this if you want more control of typescript-eslint configuration output.
44
48
  * @param {DefaultConfigOptions} options
45
49
  * @returns Array of typescript-eslint configurations
46
50
  */
47
- declare function defaultConfig(options?: DefaultConfigOptions): ConfigWithExtends[];
51
+ declare function tsEslintConfig(options?: DefaultConfigOptions): ConfigWithExtends[];
48
52
  /**
49
53
  * Exports eslint configurations. Use this if you do not need to explicitly import typescript-eslint in your project.
50
54
  * @param options
@@ -52,4 +56,4 @@ declare function defaultConfig(options?: DefaultConfigOptions): ConfigWithExtend
52
56
  */
53
57
  declare function config(options?: DefaultConfigOptions): TSESLint.FlatConfig.ConfigArray;
54
58
 
55
- export { type DefaultConfigOptions, config, defaultConfig, configs$7 as eslintConfigs, configs$6 as importConfigs, configs$5 as jsdocConfigs, configs$4 as promiseConfigs, configs$3 as reactConfigs, configs$2 as securityConfigs, configs$1 as typescriptEslintConfigs, configs as unicornConfigs };
59
+ export { type DefaultConfigOptions, config, defaultConfig, configs$7 as eslintConfigs, configs$6 as importConfigs, configs$5 as jsdocConfigs, configs$4 as promiseConfigs, configs$3 as reactConfigs, configs$2 as securityConfigs, tsEslintConfig, configs$1 as typescriptEslintConfigs, configs as unicornConfigs };
package/dist/index.mjs CHANGED
@@ -9,6 +9,7 @@ import importPlugin from 'eslint-plugin-import-x';
9
9
  import jsdoc from 'eslint-plugin-jsdoc';
10
10
  import mocha from 'eslint-plugin-mocha';
11
11
  import promise from 'eslint-plugin-promise';
12
+ import { fixupPluginRules } from '@eslint/compat';
12
13
  import a11y from 'eslint-plugin-jsx-a11y';
13
14
  import react from 'eslint-plugin-react';
14
15
  import reactHooks from 'eslint-plugin-react-hooks';
@@ -486,7 +487,7 @@ const base$3 = {
486
487
  "jsx-a11y": a11y,
487
488
  react,
488
489
  "react-hooks": reactHooks,
489
- "testing-library": testingLibrary
490
+ "testing-library": fixupPluginRules(testingLibrary)
490
491
  },
491
492
  rules: {
492
493
  ...a11y.configs.recommended.rules,
@@ -652,7 +653,8 @@ const configs = {
652
653
  base
653
654
  };
654
655
 
655
- function defaultConfig(options) {
656
+ const defaultConfig = tsEslintConfig;
657
+ function tsEslintConfig(options) {
656
658
  const enableRequireExtensionRule = options?.enableRequireExtensionRule ?? true;
657
659
  const languageOptions = {
658
660
  globals: {
@@ -747,7 +749,7 @@ function defaultConfig(options) {
747
749
  ];
748
750
  }
749
751
  function config(options) {
750
- return tsEslint.config(...defaultConfig(options));
752
+ return tsEslint.config(...tsEslintConfig(options));
751
753
  }
752
754
 
753
- export { config, defaultConfig, configs$9 as eslintConfigs, configs$7 as importConfigs, configs$6 as jsdocConfigs, configs$4 as promiseConfigs, configs$3 as reactConfigs, configs$2 as securityConfigs, configs$1 as typescriptEslintConfigs, configs as unicornConfigs };
755
+ export { config, defaultConfig, configs$9 as eslintConfigs, configs$7 as importConfigs, configs$6 as jsdocConfigs, configs$4 as promiseConfigs, configs$3 as reactConfigs, configs$2 as securityConfigs, tsEslintConfig, configs$1 as typescriptEslintConfigs, configs as unicornConfigs };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-decent",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "A decent ESLint configuration",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -72,6 +72,7 @@
72
72
  "node": ">=20.11.0"
73
73
  },
74
74
  "dependencies": {
75
+ "@eslint/compat": "1.1.1",
75
76
  "@eslint/js": "^9.8.0",
76
77
  "@typescript-eslint/utils": "8.0.0",
77
78
  "eslint-config-prettier": "^9.1.0",
package/src/index.ts CHANGED
@@ -31,12 +31,17 @@ export interface DefaultConfigOptions {
31
31
  enableRequireExtensionRule?: boolean;
32
32
  }
33
33
 
34
+ /**
35
+ * @deprecated Use `tsEslintConfig` instead
36
+ */
37
+ export const defaultConfig = tsEslintConfig;
38
+
34
39
  /**
35
40
  * Exports the default configuration to be passed to `tsEslint.config`. Use this if you want more control of typescript-eslint configuration output.
36
41
  * @param {DefaultConfigOptions} options
37
42
  * @returns Array of typescript-eslint configurations
38
43
  */
39
- export function defaultConfig(options?: DefaultConfigOptions): ConfigWithExtends[] {
44
+ export function tsEslintConfig(options?: DefaultConfigOptions): ConfigWithExtends[] {
40
45
  const enableRequireExtensionRule = options?.enableRequireExtensionRule ?? true;
41
46
  const languageOptions: ConfigWithExtends['languageOptions'] = {
42
47
  globals: {
@@ -140,5 +145,5 @@ export function defaultConfig(options?: DefaultConfigOptions): ConfigWithExtends
140
145
  * @returns An array of eslint configurations
141
146
  */
142
147
  export function config(options?: DefaultConfigOptions): TSESLint.FlatConfig.ConfigArray {
143
- return tsEslint.config(...defaultConfig(options));
148
+ return tsEslint.config(...tsEslintConfig(options));
144
149
  }
package/src/react.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { fixupPluginRules } from '@eslint/compat';
1
2
  import type { TSESLint } from '@typescript-eslint/utils';
2
3
  import a11y from 'eslint-plugin-jsx-a11y';
3
4
  import react from 'eslint-plugin-react';
@@ -9,7 +10,7 @@ const base: TSESLint.FlatConfig.Config = {
9
10
  'jsx-a11y': a11y,
10
11
  react,
11
12
  'react-hooks': reactHooks,
12
- 'testing-library': testingLibrary,
13
+ 'testing-library': fixupPluginRules(testingLibrary) as typeof testingLibrary,
13
14
  },
14
15
  rules: {
15
16
  ...a11y.configs.recommended.rules,