@smartive/eslint-config 6.0.0 → 6.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/dist/cjs/index.js CHANGED
@@ -38,6 +38,7 @@ var import_recommended = __toESM(require("eslint-plugin-prettier/recommended"));
38
38
  var import_eslint_plugin_react = __toESM(require("eslint-plugin-react"));
39
39
  var import_globals = __toESM(require("globals"));
40
40
  var import_typescript_eslint = __toESM(require("typescript-eslint"));
41
+ const JS_FILES = ["**/*.js", "**/*.mjs"];
41
42
  const reactRules = {
42
43
  "react/prop-types": "off",
43
44
  "react/display-name": "off",
@@ -56,6 +57,7 @@ const rules = (react) => ({
56
57
  "@typescript-eslint/consistent-type-definitions": "off",
57
58
  "@typescript-eslint/explicit-function-return-type": "off",
58
59
  "@typescript-eslint/explicit-module-boundary-types": "off",
60
+ "@typescript-eslint/prefer-regexp-exec": "off",
59
61
  "@typescript-eslint/no-var-requires": "warn",
60
62
  "@typescript-eslint/no-unused-vars": ["error"],
61
63
  "@typescript-eslint/no-floating-promises": ["error"],
@@ -80,35 +82,6 @@ const rules = (react) => ({
80
82
  ],
81
83
  ...react ? reactRules : {}
82
84
  });
83
- const generateLegacyConfig = (react) => ({
84
- rules: rules(react),
85
- env: {
86
- es2020: true,
87
- browser: true,
88
- node: true
89
- },
90
- parserOptions: {
91
- ecmaVersion: 2020,
92
- sourceType: "module",
93
- projectService: true
94
- },
95
- extends: [
96
- "eslint:recommended",
97
- "plugin:prettier/recommended",
98
- "plugin:import/errors",
99
- "plugin:import/warnings",
100
- "plugin:import/typescript",
101
- "plugin:@typescript-eslint/recommended-type-checked",
102
- "plugin:@typescript-eslint/stylistic-type-checked",
103
- ...react ? ["plugin:react/recommended", "plugin:react/jsx-runtime"] : []
104
- ],
105
- globals: {
106
- Atomics: "readonly",
107
- SharedArrayBuffer: "readonly"
108
- },
109
- parser: "@typescript-eslint/parser",
110
- plugins: ["@typescript-eslint", "prettier"]
111
- });
112
85
  const flatConfigTypescript = import_typescript_eslint.default.config(
113
86
  import_js.default.configs.recommended,
114
87
  import_recommended.default,
@@ -117,6 +90,10 @@ const flatConfigTypescript = import_typescript_eslint.default.config(
117
90
  import_eslint_plugin_import.flatConfigs.typescript,
118
91
  import_typescript_eslint.default.configs.recommendedTypeChecked,
119
92
  import_typescript_eslint.default.configs.stylisticTypeChecked,
93
+ {
94
+ files: JS_FILES,
95
+ extends: [import_typescript_eslint.default.configs.disableTypeChecked]
96
+ },
120
97
  {
121
98
  rules: rules(false),
122
99
  languageOptions: {
@@ -147,3 +124,38 @@ const configs = {
147
124
  typescript: flatConfigTypescript,
148
125
  react: flatConfigReact
149
126
  };
127
+ const generateLegacyConfig = (react) => ({
128
+ rules: rules(react),
129
+ env: {
130
+ es2020: true,
131
+ browser: true,
132
+ node: true
133
+ },
134
+ parserOptions: {
135
+ ecmaVersion: 2020,
136
+ sourceType: "module",
137
+ projectService: true
138
+ },
139
+ extends: [
140
+ "eslint:recommended",
141
+ "plugin:prettier/recommended",
142
+ "plugin:import/errors",
143
+ "plugin:import/warnings",
144
+ "plugin:import/typescript",
145
+ "plugin:@typescript-eslint/recommended-type-checked",
146
+ "plugin:@typescript-eslint/stylistic-type-checked",
147
+ ...react ? ["plugin:react/recommended", "plugin:react/jsx-runtime"] : []
148
+ ],
149
+ globals: {
150
+ Atomics: "readonly",
151
+ SharedArrayBuffer: "readonly"
152
+ },
153
+ parser: "@typescript-eslint/parser",
154
+ plugins: ["@typescript-eslint", "prettier"],
155
+ overrides: [
156
+ {
157
+ files: JS_FILES,
158
+ extends: ["plugin:@typescript-eslint/disable-type-checked"]
159
+ }
160
+ ]
161
+ });
package/dist/esm/index.js CHANGED
@@ -4,6 +4,7 @@ import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended"
4
4
  import reactPlugin from "eslint-plugin-react";
5
5
  import globals from "globals";
6
6
  import tsEslint from "typescript-eslint";
7
+ const JS_FILES = ["**/*.js", "**/*.mjs"];
7
8
  const reactRules = {
8
9
  "react/prop-types": "off",
9
10
  "react/display-name": "off",
@@ -22,6 +23,7 @@ const rules = (react) => ({
22
23
  "@typescript-eslint/consistent-type-definitions": "off",
23
24
  "@typescript-eslint/explicit-function-return-type": "off",
24
25
  "@typescript-eslint/explicit-module-boundary-types": "off",
26
+ "@typescript-eslint/prefer-regexp-exec": "off",
25
27
  "@typescript-eslint/no-var-requires": "warn",
26
28
  "@typescript-eslint/no-unused-vars": ["error"],
27
29
  "@typescript-eslint/no-floating-promises": ["error"],
@@ -46,35 +48,6 @@ const rules = (react) => ({
46
48
  ],
47
49
  ...react ? reactRules : {}
48
50
  });
49
- const generateLegacyConfig = (react) => ({
50
- rules: rules(react),
51
- env: {
52
- es2020: true,
53
- browser: true,
54
- node: true
55
- },
56
- parserOptions: {
57
- ecmaVersion: 2020,
58
- sourceType: "module",
59
- projectService: true
60
- },
61
- extends: [
62
- "eslint:recommended",
63
- "plugin:prettier/recommended",
64
- "plugin:import/errors",
65
- "plugin:import/warnings",
66
- "plugin:import/typescript",
67
- "plugin:@typescript-eslint/recommended-type-checked",
68
- "plugin:@typescript-eslint/stylistic-type-checked",
69
- ...react ? ["plugin:react/recommended", "plugin:react/jsx-runtime"] : []
70
- ],
71
- globals: {
72
- Atomics: "readonly",
73
- SharedArrayBuffer: "readonly"
74
- },
75
- parser: "@typescript-eslint/parser",
76
- plugins: ["@typescript-eslint", "prettier"]
77
- });
78
51
  const flatConfigTypescript = tsEslint.config(
79
52
  js.configs.recommended,
80
53
  eslintPluginPrettierRecommended,
@@ -83,6 +56,10 @@ const flatConfigTypescript = tsEslint.config(
83
56
  eslintPluginImportConfigs.typescript,
84
57
  tsEslint.configs.recommendedTypeChecked,
85
58
  tsEslint.configs.stylisticTypeChecked,
59
+ {
60
+ files: JS_FILES,
61
+ extends: [tsEslint.configs.disableTypeChecked]
62
+ },
86
63
  {
87
64
  rules: rules(false),
88
65
  languageOptions: {
@@ -113,6 +90,41 @@ const configs = {
113
90
  typescript: flatConfigTypescript,
114
91
  react: flatConfigReact
115
92
  };
93
+ const generateLegacyConfig = (react) => ({
94
+ rules: rules(react),
95
+ env: {
96
+ es2020: true,
97
+ browser: true,
98
+ node: true
99
+ },
100
+ parserOptions: {
101
+ ecmaVersion: 2020,
102
+ sourceType: "module",
103
+ projectService: true
104
+ },
105
+ extends: [
106
+ "eslint:recommended",
107
+ "plugin:prettier/recommended",
108
+ "plugin:import/errors",
109
+ "plugin:import/warnings",
110
+ "plugin:import/typescript",
111
+ "plugin:@typescript-eslint/recommended-type-checked",
112
+ "plugin:@typescript-eslint/stylistic-type-checked",
113
+ ...react ? ["plugin:react/recommended", "plugin:react/jsx-runtime"] : []
114
+ ],
115
+ globals: {
116
+ Atomics: "readonly",
117
+ SharedArrayBuffer: "readonly"
118
+ },
119
+ parser: "@typescript-eslint/parser",
120
+ plugins: ["@typescript-eslint", "prettier"],
121
+ overrides: [
122
+ {
123
+ files: JS_FILES,
124
+ extends: ["plugin:@typescript-eslint/disable-type-checked"]
125
+ }
126
+ ]
127
+ });
116
128
  export {
117
129
  configs,
118
130
  generateLegacyConfig
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { Linter } from 'eslint';
2
- export declare const generateLegacyConfig: (react: boolean) => Linter.LegacyConfig;
3
2
  export declare const configs: {
4
3
  typescript: import("@typescript-eslint/utils/dist/ts-eslint").FlatConfig.ConfigArray;
5
4
  react: import("@typescript-eslint/utils/dist/ts-eslint").FlatConfig.ConfigArray;
6
5
  };
6
+ export declare const generateLegacyConfig: (react: boolean) => Linter.LegacyConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartive/eslint-config",
3
- "version": "6.0.0",
3
+ "version": "6.2.0",
4
4
  "description": "ESLint configuration by smartive",
5
5
  "files": [
6
6
  "README.md",