@zthun/janitor-eslint-config 19.2.0 → 19.2.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/dist/index.cjs CHANGED
@@ -1,148 +1,202 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const globals = require("globals");
4
- const _import = require("eslint-plugin-import");
5
- const js = require("@eslint/js");
6
- const pretty = require("eslint-plugin-prettier/recommended");
7
- const _react = require("eslint-plugin-react");
8
- const ts = require("typescript-eslint");
9
- function environment(environment2) {
10
- return {
11
- languageOptions: {
12
- globals: {
13
- ...environment2
14
- }
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const globals = require('globals');
6
+ const _import = require('eslint-plugin-import');
7
+ const js = require('@eslint/js');
8
+ const pretty = require('eslint-plugin-prettier/recommended');
9
+ const _react = require('eslint-plugin-react');
10
+ const ts = require('typescript-eslint');
11
+
12
+ function _define_property(obj, key, value) {
13
+ if (key in obj) {
14
+ Object.defineProperty(obj, key, {
15
+ value: value,
16
+ enumerable: true,
17
+ configurable: true,
18
+ writable: true
19
+ });
20
+ } else {
21
+ obj[key] = value;
15
22
  }
16
- };
23
+ return obj;
24
+ }
25
+ function _object_spread(target) {
26
+ for(var i = 1; i < arguments.length; i++){
27
+ var source = arguments[i] != null ? arguments[i] : {};
28
+ var ownKeys = Object.keys(source);
29
+ if (typeof Object.getOwnPropertySymbols === "function") {
30
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
31
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
32
+ }));
33
+ }
34
+ ownKeys.forEach(function(key) {
35
+ _define_property(target, key, source[key]);
36
+ });
37
+ }
38
+ return target;
39
+ }
40
+ function environment(environment) {
41
+ return {
42
+ languageOptions: {
43
+ globals: _object_spread({}, environment)
44
+ }
45
+ };
17
46
  }
18
47
  const environments = {
19
- browser: [environment(globals.browser)],
20
- node: [environment(globals.node), environment(globals.nodeBuiltin)]
48
+ browser: [
49
+ environment(globals.browser)
50
+ ],
51
+ node: [
52
+ environment(globals.node),
53
+ environment(globals.nodeBuiltin)
54
+ ]
21
55
  };
56
+
22
57
  const imports = [
23
- _import.flatConfigs.recommended,
24
- {
25
- rules: {
26
- // This lint error is the main reason to use import as we want to make
27
- // sure we've installed our dependencies correctly.
28
- "import/no-extraneous-dependencies": "error",
29
- // These are straight up broken with Typescript when you need to work with
30
- // mts files that must have the file extension present. These can be fixed
31
- // using resolves, but it's such a pain and it's just not worth the hassle
32
- // for basic linting support. The no-extraneous-dependencies is really
33
- // the recommended config we want, so these being forced off are fine.
34
- "import/named": "off",
35
- "import/no-unresolved": "off"
58
+ _import.flatConfigs.recommended,
59
+ {
60
+ rules: {
61
+ // This lint error is the main reason to use import as we want to make
62
+ // sure we've installed our dependencies correctly.
63
+ "import/no-extraneous-dependencies": "error",
64
+ // These are straight up broken with Typescript when you need to work with
65
+ // mts files that must have the file extension present. These can be fixed
66
+ // using resolves, but it's such a pain and it's just not worth the hassle
67
+ // for basic linting support. The no-extraneous-dependencies is really
68
+ // the recommended config we want, so these being forced off are fine.
69
+ "import/named": "off",
70
+ "import/no-unresolved": "off"
71
+ }
36
72
  }
37
- }
38
73
  ];
74
+
39
75
  const javascript = [
40
- js.configs.recommended,
41
- {
42
- rules: {
43
- // We want to support == null so we get a good check for undefined
44
- // or null
45
- eqeqeq: ["error", "smart"],
46
- // Would be fine, but there's a bug in this where you have a function with
47
- // access arguments. Those constructors are often empty - so we want to let
48
- // a part of this one through.
49
- "no-empty-function": "off"
76
+ js.configs.recommended,
77
+ {
78
+ rules: {
79
+ // We want to support == null so we get a good check for undefined
80
+ // or null
81
+ eqeqeq: [
82
+ "error",
83
+ "smart"
84
+ ],
85
+ // Would be fine, but there's a bug in this where you have a function with
86
+ // access arguments. Those constructors are often empty - so we want to let
87
+ // a part of this one through.
88
+ "no-empty-function": "off"
89
+ }
50
90
  }
51
- }
52
91
  ];
53
- const prettier = [pretty];
92
+
93
+ const prettier = [
94
+ pretty
95
+ ];
96
+
54
97
  const react = [
55
- {
56
- files: ["**/*.{js,cjs,mjs,ts,mts,jsx,tsx}"],
57
- plugins: {
58
- react: _react
59
- },
60
- languageOptions: {
61
- parserOptions: {
62
- ecmaFeatures: {
63
- jsx: true
98
+ {
99
+ files: [
100
+ "**/*.{js,cjs,mjs,ts,mts,jsx,tsx}"
101
+ ],
102
+ plugins: {
103
+ react: _react
104
+ },
105
+ languageOptions: {
106
+ parserOptions: {
107
+ ecmaFeatures: {
108
+ jsx: true
109
+ }
110
+ }
111
+ },
112
+ settings: {
113
+ react: {
114
+ version: "detect"
115
+ }
116
+ },
117
+ rules: {
118
+ // This one is not needed any longer as TypeScript jsx option
119
+ // should be set to react-jsx. You will need to turn this on
120
+ // manually if it is set to the legacy react setting. See
121
+ // https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#whats-different-in-the-new-transform
122
+ "react/react-in-jsx-scope": "off"
64
123
  }
65
- }
66
- },
67
- settings: {
68
- react: {
69
- version: "detect"
70
- }
71
- },
72
- rules: {
73
- // This one is not needed any longer as TypeScript jsx option
74
- // should be set to react-jsx. You will need to turn this on
75
- // manually if it is set to the legacy react setting. See
76
- // https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#whats-different-in-the-new-transform
77
- "react/react-in-jsx-scope": "off"
78
124
  }
79
- }
80
125
  ];
126
+
81
127
  const typescript = [
82
- ...ts.configs.recommended,
83
- {
84
- rules: {
85
- // We want to be able to use a single build system for most things.
86
- // Ideally, we can use vite to build all project types so we don't
87
- // have 4 different build systems across different projects. Thus
88
- // we need to make sure that swc, esbuild, and tsc are supported.
89
- // Forcing type imports ensures this.
90
- "@typescript-eslint/consistent-type-imports": [
91
- "error",
92
- { prefer: "type-imports" }
93
- ],
94
- // There are times when any and legacy namespaces makes sense.
95
- // If you use any kind of decorator library, you will almost
96
- // be required to use any at some point. Forcing a non use of them
97
- // means you're spending a bunch of time play type gymnastics and to
98
- // hell with that.
99
- "@typescript-eslint/no-explicit-any": "off",
100
- "@typescript-eslint/no-namespace": "off",
101
- // Would be fine, but there's a bug in this where you have a function with
102
- // access arguments. Those constructors are often empty - so we want to let
103
- // a part of this one through.
104
- "no-empty-function": "off",
105
- "@typescript-eslint/no-empty-function": [
106
- "error",
107
- { allow: ["constructors"] }
108
- ],
109
- // A lot of 3rd party libraries still don't support esm
110
- // and trying to force this right now just isn't feasible.
111
- "@typescript-eslint/no-var-requires": "off",
112
- "@typescript-eslint/no-require-imports": "off",
113
- // I want aliasing support.
114
- "@typescript-eslint/no-empty-object-type": "off",
115
- "@typescript-eslint/no-empty-interface": "off",
116
- // You will need unsafe declaration merging if you are doing anything
117
- // with decorators as what often happens is that TypeScript cannot infer
118
- // the output type of a decorator. So this has to be on to deal with
119
- // TypeScripts shortcoming in this department. See
120
- // https://github.com/microsoft/TypeScript/issues/4881 for more information.
121
- "@typescript-eslint/no-unsafe-declaration-merging": "off",
122
- // I can technically agree with this, but where this comes in
123
- // handy is unit testing and I value that, so I want support
124
- // to make the assumption that I know what I'm doing when
125
- // I make a non-null assertion.
126
- "@typescript-eslint/no-non-null-assertion": "off",
127
- // This is actually fine, but this is broken in typescript eslint 8.14.x.
128
- // See https://github.com/typescript-eslint/typescript-eslint/issues/10353
129
- // for the bug.
130
- "no-unused-expressions": "off",
131
- "@typescript-eslint/no-unused-expressions": [
132
- "error",
133
- {
134
- allowShortCircuit: false
128
+ ...ts.configs.recommended,
129
+ {
130
+ rules: {
131
+ // We want to be able to use a single build system for most things.
132
+ // Ideally, we can use vite to build all project types so we don't
133
+ // have 4 different build systems across different projects. Thus
134
+ // we need to make sure that swc, esbuild, and tsc are supported.
135
+ // Forcing type imports ensures this.
136
+ "@typescript-eslint/consistent-type-imports": [
137
+ "error",
138
+ {
139
+ prefer: "type-imports"
140
+ }
141
+ ],
142
+ // There are times when any and legacy namespaces makes sense.
143
+ // If you use any kind of decorator library, you will almost
144
+ // be required to use any at some point. Forcing a non use of them
145
+ // means you're spending a bunch of time play type gymnastics and to
146
+ // hell with that.
147
+ "@typescript-eslint/no-explicit-any": "off",
148
+ "@typescript-eslint/no-namespace": "off",
149
+ // Would be fine, but there's a bug in this where you have a function with
150
+ // access arguments. Those constructors are often empty - so we want to let
151
+ // a part of this one through.
152
+ "no-empty-function": "off",
153
+ "@typescript-eslint/no-empty-function": [
154
+ "error",
155
+ {
156
+ allow: [
157
+ "constructors"
158
+ ]
159
+ }
160
+ ],
161
+ // A lot of 3rd party libraries still don't support esm
162
+ // and trying to force this right now just isn't feasible.
163
+ "@typescript-eslint/no-var-requires": "off",
164
+ "@typescript-eslint/no-require-imports": "off",
165
+ // I want aliasing support.
166
+ "@typescript-eslint/no-empty-object-type": "off",
167
+ "@typescript-eslint/no-empty-interface": "off",
168
+ // You will need unsafe declaration merging if you are doing anything
169
+ // with decorators as what often happens is that TypeScript cannot infer
170
+ // the output type of a decorator. So this has to be on to deal with
171
+ // TypeScripts shortcoming in this department. See
172
+ // https://github.com/microsoft/TypeScript/issues/4881 for more information.
173
+ "@typescript-eslint/no-unsafe-declaration-merging": "off",
174
+ // I can technically agree with this, but where this comes in
175
+ // handy is unit testing and I value that, so I want support
176
+ // to make the assumption that I know what I'm doing when
177
+ // I make a non-null assertion.
178
+ "@typescript-eslint/no-non-null-assertion": "off",
179
+ // This is actually fine, but this is broken in typescript eslint 8.14.x.
180
+ // See https://github.com/typescript-eslint/typescript-eslint/issues/10353
181
+ // for the bug.
182
+ "no-unused-expressions": "off",
183
+ "@typescript-eslint/no-unused-expressions": [
184
+ "error",
185
+ {
186
+ allowShortCircuit: false
187
+ }
188
+ ]
135
189
  }
136
- ]
137
190
  }
138
- }
139
191
  ];
192
+
140
193
  const recommended = [
141
- ...javascript,
142
- ...typescript,
143
- ...imports,
144
- ...prettier
194
+ ...javascript,
195
+ ...typescript,
196
+ ...imports,
197
+ ...prettier
145
198
  ];
199
+
146
200
  exports.environments = environments;
147
201
  exports.imports = imports;
148
202
  exports.javascript = javascript;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/configs/environments.mts","../src/configs/imports.mts","../src/configs/javascript.mts","../src/configs/prettier.mts","../src/configs/react.mts","../src/configs/typescript.mts","../src/configs/recommended.mts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport globals from \"globals\";\n\nfunction environment(environment: object): Linter.Config {\n return {\n languageOptions: {\n globals: {\n ...environment,\n },\n },\n };\n}\n\nexport const environments = {\n browser: [environment(globals.browser)],\n node: [environment(globals.node), environment(globals.nodeBuiltin)],\n};\n","import type { Linter } from \"eslint\";\nimport _import from \"eslint-plugin-import\";\n\nexport const imports: Linter.Config[] = [\n _import.flatConfigs.recommended,\n {\n rules: {\n // This lint error is the main reason to use import as we want to make\n // sure we've installed our dependencies correctly.\n \"import/no-extraneous-dependencies\": \"error\",\n\n // These are straight up broken with Typescript when you need to work with\n // mts files that must have the file extension present. These can be fixed\n // using resolves, but it's such a pain and it's just not worth the hassle\n // for basic linting support. The no-extraneous-dependencies is really\n // the recommended config we want, so these being forced off are fine.\n \"import/named\": \"off\",\n \"import/no-unresolved\": \"off\",\n },\n } satisfies Linter.Config,\n];\n","import js from \"@eslint/js\";\nimport type { Linter } from \"eslint\";\n\nexport const javascript: Linter.Config[] = [\n js.configs.recommended,\n {\n rules: {\n // We want to support == null so we get a good check for undefined\n // or null\n eqeqeq: [\"error\", \"smart\"],\n // Would be fine, but there's a bug in this where you have a function with\n // access arguments. Those constructors are often empty - so we want to let\n // a part of this one through.\n \"no-empty-function\": \"off\",\n },\n },\n];\n","import pretty from \"eslint-plugin-prettier/recommended\";\n\nexport const prettier = [pretty];\n","import type { ESLint, Linter } from \"eslint\";\nimport _react from \"eslint-plugin-react\";\n\nexport const react: Linter.Config[] = [\n {\n files: [\"**/*.{js,cjs,mjs,ts,mts,jsx,tsx}\"],\n plugins: {\n react: _react as ESLint.Plugin,\n },\n languageOptions: {\n parserOptions: {\n ecmaFeatures: {\n jsx: true,\n },\n },\n },\n settings: {\n react: {\n version: \"detect\",\n },\n },\n rules: {\n // This one is not needed any longer as TypeScript jsx option\n // should be set to react-jsx. You will need to turn this on\n // manually if it is set to the legacy react setting. See\n // https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#whats-different-in-the-new-transform\n \"react/react-in-jsx-scope\": \"off\",\n },\n },\n];\n","import type { Linter } from \"eslint\";\nimport ts from \"typescript-eslint\";\n\nexport const typescript = [\n ...ts.configs.recommended,\n {\n rules: {\n // We want to be able to use a single build system for most things.\n // Ideally, we can use vite to build all project types so we don't\n // have 4 different build systems across different projects. Thus\n // we need to make sure that swc, esbuild, and tsc are supported.\n // Forcing type imports ensures this.\n \"@typescript-eslint/consistent-type-imports\": [\n \"error\",\n { prefer: \"type-imports\" },\n ],\n // There are times when any and legacy namespaces makes sense.\n // If you use any kind of decorator library, you will almost\n // be required to use any at some point. Forcing a non use of them\n // means you're spending a bunch of time play type gymnastics and to\n // hell with that.\n \"@typescript-eslint/no-explicit-any\": \"off\",\n \"@typescript-eslint/no-namespace\": \"off\",\n\n // Would be fine, but there's a bug in this where you have a function with\n // access arguments. Those constructors are often empty - so we want to let\n // a part of this one through.\n \"no-empty-function\": \"off\",\n \"@typescript-eslint/no-empty-function\": [\n \"error\",\n { allow: [\"constructors\"] },\n ],\n\n // A lot of 3rd party libraries still don't support esm\n // and trying to force this right now just isn't feasible.\n \"@typescript-eslint/no-var-requires\": \"off\",\n \"@typescript-eslint/no-require-imports\": \"off\",\n\n // I want aliasing support.\n \"@typescript-eslint/no-empty-object-type\": \"off\",\n \"@typescript-eslint/no-empty-interface\": \"off\",\n\n // You will need unsafe declaration merging if you are doing anything\n // with decorators as what often happens is that TypeScript cannot infer\n // the output type of a decorator. So this has to be on to deal with\n // TypeScripts shortcoming in this department. See\n // https://github.com/microsoft/TypeScript/issues/4881 for more information.\n \"@typescript-eslint/no-unsafe-declaration-merging\": \"off\",\n\n // I can technically agree with this, but where this comes in\n // handy is unit testing and I value that, so I want support\n // to make the assumption that I know what I'm doing when\n // I make a non-null assertion.\n \"@typescript-eslint/no-non-null-assertion\": \"off\",\n\n // This is actually fine, but this is broken in typescript eslint 8.14.x.\n // See https://github.com/typescript-eslint/typescript-eslint/issues/10353\n // for the bug.\n \"no-unused-expressions\": \"off\",\n \"@typescript-eslint/no-unused-expressions\": [\n \"error\",\n {\n allowShortCircuit: false,\n },\n ],\n },\n } satisfies Linter.Config,\n];\n","import { imports } from \"./imports.mjs\";\nimport { javascript } from \"./javascript.mjs\";\nimport { prettier } from \"./prettier.mjs\";\nimport { typescript } from \"./typescript.mjs\";\n\nexport const recommended = [\n ...javascript,\n ...typescript,\n ...imports,\n ...prettier,\n];\n"],"names":["environment"],"mappings":";;;;;;;;AAGA,SAAS,YAAYA,cAAoC;AAChD,SAAA;AAAA,IACL,iBAAiB;AAAA,MACf,SAAS;AAAA,QACP,GAAGA;AAAAA,MAAA;AAAA,IACL;AAAA,EAEJ;AACF;AAEO,MAAM,eAAe;AAAA,EAC1B,SAAS,CAAC,YAAY,QAAQ,OAAO,CAAC;AAAA,EACtC,MAAM,CAAC,YAAY,QAAQ,IAAI,GAAG,YAAY,QAAQ,WAAW,CAAC;AACpE;ACbO,MAAM,UAA2B;AAAA,EACtC,QAAQ,YAAY;AAAA,EACpB;AAAA,IACE,OAAO;AAAA;AAAA;AAAA,MAGL,qCAAqC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOrC,gBAAgB;AAAA,MAChB,wBAAwB;AAAA,IAAA;AAAA,EAC1B;AAEJ;ACjBO,MAAM,aAA8B;AAAA,EACzC,GAAG,QAAQ;AAAA,EACX;AAAA,IACE,OAAO;AAAA;AAAA;AAAA,MAGL,QAAQ,CAAC,SAAS,OAAO;AAAA;AAAA;AAAA;AAAA,MAIzB,qBAAqB;AAAA,IAAA;AAAA,EACvB;AAEJ;ACda,MAAA,WAAW,CAAC,M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
1
+ {"version":3,"file":"index.cjs","sources":["../src/configs/environments.mts","../src/configs/imports.mts","../src/configs/javascript.mts","../src/configs/prettier.mts","../src/configs/react.mts","../src/configs/typescript.mts","../src/configs/recommended.mts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport globals from \"globals\";\n\nfunction environment(environment: object): Linter.Config {\n return {\n languageOptions: {\n globals: {\n ...environment,\n },\n },\n };\n}\n\nexport const environments = {\n browser: [environment(globals.browser)],\n node: [environment(globals.node), environment(globals.nodeBuiltin)],\n};\n","import type { Linter } from \"eslint\";\nimport _import from \"eslint-plugin-import\";\n\nexport const imports: Linter.Config[] = [\n _import.flatConfigs.recommended,\n {\n rules: {\n // This lint error is the main reason to use import as we want to make\n // sure we've installed our dependencies correctly.\n \"import/no-extraneous-dependencies\": \"error\",\n\n // These are straight up broken with Typescript when you need to work with\n // mts files that must have the file extension present. These can be fixed\n // using resolves, but it's such a pain and it's just not worth the hassle\n // for basic linting support. The no-extraneous-dependencies is really\n // the recommended config we want, so these being forced off are fine.\n \"import/named\": \"off\",\n \"import/no-unresolved\": \"off\",\n },\n } satisfies Linter.Config,\n];\n","import js from \"@eslint/js\";\nimport type { Linter } from \"eslint\";\n\nexport const javascript: Linter.Config[] = [\n js.configs.recommended,\n {\n rules: {\n // We want to support == null so we get a good check for undefined\n // or null\n eqeqeq: [\"error\", \"smart\"],\n // Would be fine, but there's a bug in this where you have a function with\n // access arguments. Those constructors are often empty - so we want to let\n // a part of this one through.\n \"no-empty-function\": \"off\",\n },\n },\n];\n","import pretty from \"eslint-plugin-prettier/recommended\";\n\nexport const prettier = [pretty];\n","import type { ESLint, Linter } from \"eslint\";\nimport _react from \"eslint-plugin-react\";\n\nexport const react: Linter.Config[] = [\n {\n files: [\"**/*.{js,cjs,mjs,ts,mts,jsx,tsx}\"],\n plugins: {\n react: _react as ESLint.Plugin,\n },\n languageOptions: {\n parserOptions: {\n ecmaFeatures: {\n jsx: true,\n },\n },\n },\n settings: {\n react: {\n version: \"detect\",\n },\n },\n rules: {\n // This one is not needed any longer as TypeScript jsx option\n // should be set to react-jsx. You will need to turn this on\n // manually if it is set to the legacy react setting. See\n // https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#whats-different-in-the-new-transform\n \"react/react-in-jsx-scope\": \"off\",\n },\n },\n];\n","import type { Linter } from \"eslint\";\nimport ts from \"typescript-eslint\";\n\nexport const typescript = [\n ...ts.configs.recommended,\n {\n rules: {\n // We want to be able to use a single build system for most things.\n // Ideally, we can use vite to build all project types so we don't\n // have 4 different build systems across different projects. Thus\n // we need to make sure that swc, esbuild, and tsc are supported.\n // Forcing type imports ensures this.\n \"@typescript-eslint/consistent-type-imports\": [\n \"error\",\n { prefer: \"type-imports\" },\n ],\n // There are times when any and legacy namespaces makes sense.\n // If you use any kind of decorator library, you will almost\n // be required to use any at some point. Forcing a non use of them\n // means you're spending a bunch of time play type gymnastics and to\n // hell with that.\n \"@typescript-eslint/no-explicit-any\": \"off\",\n \"@typescript-eslint/no-namespace\": \"off\",\n\n // Would be fine, but there's a bug in this where you have a function with\n // access arguments. Those constructors are often empty - so we want to let\n // a part of this one through.\n \"no-empty-function\": \"off\",\n \"@typescript-eslint/no-empty-function\": [\n \"error\",\n { allow: [\"constructors\"] },\n ],\n\n // A lot of 3rd party libraries still don't support esm\n // and trying to force this right now just isn't feasible.\n \"@typescript-eslint/no-var-requires\": \"off\",\n \"@typescript-eslint/no-require-imports\": \"off\",\n\n // I want aliasing support.\n \"@typescript-eslint/no-empty-object-type\": \"off\",\n \"@typescript-eslint/no-empty-interface\": \"off\",\n\n // You will need unsafe declaration merging if you are doing anything\n // with decorators as what often happens is that TypeScript cannot infer\n // the output type of a decorator. So this has to be on to deal with\n // TypeScripts shortcoming in this department. See\n // https://github.com/microsoft/TypeScript/issues/4881 for more information.\n \"@typescript-eslint/no-unsafe-declaration-merging\": \"off\",\n\n // I can technically agree with this, but where this comes in\n // handy is unit testing and I value that, so I want support\n // to make the assumption that I know what I'm doing when\n // I make a non-null assertion.\n \"@typescript-eslint/no-non-null-assertion\": \"off\",\n\n // This is actually fine, but this is broken in typescript eslint 8.14.x.\n // See https://github.com/typescript-eslint/typescript-eslint/issues/10353\n // for the bug.\n \"no-unused-expressions\": \"off\",\n \"@typescript-eslint/no-unused-expressions\": [\n \"error\",\n {\n allowShortCircuit: false,\n },\n ],\n },\n } satisfies Linter.Config,\n];\n","import { imports } from \"./imports.mjs\";\nimport { javascript } from \"./javascript.mjs\";\nimport { prettier } from \"./prettier.mjs\";\nimport { typescript } from \"./typescript.mjs\";\n\nexport const recommended = [\n ...javascript,\n ...typescript,\n ...imports,\n ...prettier,\n];\n"],"names":["environment","languageOptions","globals","environments","browser","node","nodeBuiltin","imports","_import","flatConfigs","recommended","rules","javascript","js","configs","eqeqeq","prettier","pretty","react","files","plugins","_react","parserOptions","ecmaFeatures","jsx","settings","version","typescript","ts","prefer","allow","allowShortCircuit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,SAASA,YAAYA,WAAmB,EAAA;IACtC,OAAO;QACLC,eAAiB,EAAA;AACfC,YAAAA,OAAAA,EAAS,cACJF,CAAAA,EAAAA,EAAAA,WAAAA;AAEP;AACF,KAAA;AACF;MAEaG,YAAe,GAAA;IAC1BC,OAAS,EAAA;AAACJ,QAAAA,WAAAA,CAAYE,QAAQE,OAAO;AAAE,KAAA;IACvCC,IAAM,EAAA;AAACL,QAAAA,WAAAA,CAAYE,QAAQG,IAAI,CAAA;AAAGL,QAAAA,WAAAA,CAAYE,QAAQI,WAAW;AAAE;AACrE;;MCbaC,OAA2B,GAAA;IACtCC,OAAQC,CAAAA,WAAW,CAACC,WAAW;AAC/B,IAAA;QACEC,KAAO,EAAA;;;YAGL,mCAAqC,EAAA,OAAA;;;;;;YAOrC,cAAgB,EAAA,KAAA;YAChB,sBAAwB,EAAA;AAC1B;AACF;;;MChBWC,UAA8B,GAAA;IACzCC,EAAGC,CAAAA,OAAO,CAAC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;;;MC7DWrB,WAAc,GAAA;AACtBE,IAAAA,GAAAA,UAAAA;AACAe,IAAAA,GAAAA,UAAAA;AACApB,IAAAA,GAAAA,OAAAA;AACAS,IAAAA,GAAAA;;;;;;;;;;;"}
package/dist/index.js CHANGED
@@ -1,153 +1,197 @@
1
- import globals from "globals";
2
- import _import from "eslint-plugin-import";
3
- import js from "@eslint/js";
4
- import pretty from "eslint-plugin-prettier/recommended";
5
- import _react from "eslint-plugin-react";
6
- import ts from "typescript-eslint";
7
- function environment(environment2) {
8
- return {
9
- languageOptions: {
10
- globals: {
11
- ...environment2
12
- }
1
+ import globals from 'globals';
2
+ import _import from 'eslint-plugin-import';
3
+ import js from '@eslint/js';
4
+ import pretty from 'eslint-plugin-prettier/recommended';
5
+ import _react from 'eslint-plugin-react';
6
+ import ts from 'typescript-eslint';
7
+
8
+ function _define_property(obj, key, value) {
9
+ if (key in obj) {
10
+ Object.defineProperty(obj, key, {
11
+ value: value,
12
+ enumerable: true,
13
+ configurable: true,
14
+ writable: true
15
+ });
16
+ } else {
17
+ obj[key] = value;
13
18
  }
14
- };
19
+ return obj;
20
+ }
21
+ function _object_spread(target) {
22
+ for(var i = 1; i < arguments.length; i++){
23
+ var source = arguments[i] != null ? arguments[i] : {};
24
+ var ownKeys = Object.keys(source);
25
+ if (typeof Object.getOwnPropertySymbols === "function") {
26
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
27
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
28
+ }));
29
+ }
30
+ ownKeys.forEach(function(key) {
31
+ _define_property(target, key, source[key]);
32
+ });
33
+ }
34
+ return target;
35
+ }
36
+ function environment(environment) {
37
+ return {
38
+ languageOptions: {
39
+ globals: _object_spread({}, environment)
40
+ }
41
+ };
15
42
  }
16
43
  const environments = {
17
- browser: [environment(globals.browser)],
18
- node: [environment(globals.node), environment(globals.nodeBuiltin)]
44
+ browser: [
45
+ environment(globals.browser)
46
+ ],
47
+ node: [
48
+ environment(globals.node),
49
+ environment(globals.nodeBuiltin)
50
+ ]
19
51
  };
52
+
20
53
  const imports = [
21
- _import.flatConfigs.recommended,
22
- {
23
- rules: {
24
- // This lint error is the main reason to use import as we want to make
25
- // sure we've installed our dependencies correctly.
26
- "import/no-extraneous-dependencies": "error",
27
- // These are straight up broken with Typescript when you need to work with
28
- // mts files that must have the file extension present. These can be fixed
29
- // using resolves, but it's such a pain and it's just not worth the hassle
30
- // for basic linting support. The no-extraneous-dependencies is really
31
- // the recommended config we want, so these being forced off are fine.
32
- "import/named": "off",
33
- "import/no-unresolved": "off"
54
+ _import.flatConfigs.recommended,
55
+ {
56
+ rules: {
57
+ // This lint error is the main reason to use import as we want to make
58
+ // sure we've installed our dependencies correctly.
59
+ "import/no-extraneous-dependencies": "error",
60
+ // These are straight up broken with Typescript when you need to work with
61
+ // mts files that must have the file extension present. These can be fixed
62
+ // using resolves, but it's such a pain and it's just not worth the hassle
63
+ // for basic linting support. The no-extraneous-dependencies is really
64
+ // the recommended config we want, so these being forced off are fine.
65
+ "import/named": "off",
66
+ "import/no-unresolved": "off"
67
+ }
34
68
  }
35
- }
36
69
  ];
70
+
37
71
  const javascript = [
38
- js.configs.recommended,
39
- {
40
- rules: {
41
- // We want to support == null so we get a good check for undefined
42
- // or null
43
- eqeqeq: ["error", "smart"],
44
- // Would be fine, but there's a bug in this where you have a function with
45
- // access arguments. Those constructors are often empty - so we want to let
46
- // a part of this one through.
47
- "no-empty-function": "off"
72
+ js.configs.recommended,
73
+ {
74
+ rules: {
75
+ // We want to support == null so we get a good check for undefined
76
+ // or null
77
+ eqeqeq: [
78
+ "error",
79
+ "smart"
80
+ ],
81
+ // Would be fine, but there's a bug in this where you have a function with
82
+ // access arguments. Those constructors are often empty - so we want to let
83
+ // a part of this one through.
84
+ "no-empty-function": "off"
85
+ }
48
86
  }
49
- }
50
87
  ];
51
- const prettier = [pretty];
88
+
89
+ const prettier = [
90
+ pretty
91
+ ];
92
+
52
93
  const react = [
53
- {
54
- files: ["**/*.{js,cjs,mjs,ts,mts,jsx,tsx}"],
55
- plugins: {
56
- react: _react
57
- },
58
- languageOptions: {
59
- parserOptions: {
60
- ecmaFeatures: {
61
- jsx: true
94
+ {
95
+ files: [
96
+ "**/*.{js,cjs,mjs,ts,mts,jsx,tsx}"
97
+ ],
98
+ plugins: {
99
+ react: _react
100
+ },
101
+ languageOptions: {
102
+ parserOptions: {
103
+ ecmaFeatures: {
104
+ jsx: true
105
+ }
106
+ }
107
+ },
108
+ settings: {
109
+ react: {
110
+ version: "detect"
111
+ }
112
+ },
113
+ rules: {
114
+ // This one is not needed any longer as TypeScript jsx option
115
+ // should be set to react-jsx. You will need to turn this on
116
+ // manually if it is set to the legacy react setting. See
117
+ // https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#whats-different-in-the-new-transform
118
+ "react/react-in-jsx-scope": "off"
62
119
  }
63
- }
64
- },
65
- settings: {
66
- react: {
67
- version: "detect"
68
- }
69
- },
70
- rules: {
71
- // This one is not needed any longer as TypeScript jsx option
72
- // should be set to react-jsx. You will need to turn this on
73
- // manually if it is set to the legacy react setting. See
74
- // https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#whats-different-in-the-new-transform
75
- "react/react-in-jsx-scope": "off"
76
120
  }
77
- }
78
121
  ];
122
+
79
123
  const typescript = [
80
- ...ts.configs.recommended,
81
- {
82
- rules: {
83
- // We want to be able to use a single build system for most things.
84
- // Ideally, we can use vite to build all project types so we don't
85
- // have 4 different build systems across different projects. Thus
86
- // we need to make sure that swc, esbuild, and tsc are supported.
87
- // Forcing type imports ensures this.
88
- "@typescript-eslint/consistent-type-imports": [
89
- "error",
90
- { prefer: "type-imports" }
91
- ],
92
- // There are times when any and legacy namespaces makes sense.
93
- // If you use any kind of decorator library, you will almost
94
- // be required to use any at some point. Forcing a non use of them
95
- // means you're spending a bunch of time play type gymnastics and to
96
- // hell with that.
97
- "@typescript-eslint/no-explicit-any": "off",
98
- "@typescript-eslint/no-namespace": "off",
99
- // Would be fine, but there's a bug in this where you have a function with
100
- // access arguments. Those constructors are often empty - so we want to let
101
- // a part of this one through.
102
- "no-empty-function": "off",
103
- "@typescript-eslint/no-empty-function": [
104
- "error",
105
- { allow: ["constructors"] }
106
- ],
107
- // A lot of 3rd party libraries still don't support esm
108
- // and trying to force this right now just isn't feasible.
109
- "@typescript-eslint/no-var-requires": "off",
110
- "@typescript-eslint/no-require-imports": "off",
111
- // I want aliasing support.
112
- "@typescript-eslint/no-empty-object-type": "off",
113
- "@typescript-eslint/no-empty-interface": "off",
114
- // You will need unsafe declaration merging if you are doing anything
115
- // with decorators as what often happens is that TypeScript cannot infer
116
- // the output type of a decorator. So this has to be on to deal with
117
- // TypeScripts shortcoming in this department. See
118
- // https://github.com/microsoft/TypeScript/issues/4881 for more information.
119
- "@typescript-eslint/no-unsafe-declaration-merging": "off",
120
- // I can technically agree with this, but where this comes in
121
- // handy is unit testing and I value that, so I want support
122
- // to make the assumption that I know what I'm doing when
123
- // I make a non-null assertion.
124
- "@typescript-eslint/no-non-null-assertion": "off",
125
- // This is actually fine, but this is broken in typescript eslint 8.14.x.
126
- // See https://github.com/typescript-eslint/typescript-eslint/issues/10353
127
- // for the bug.
128
- "no-unused-expressions": "off",
129
- "@typescript-eslint/no-unused-expressions": [
130
- "error",
131
- {
132
- allowShortCircuit: false
124
+ ...ts.configs.recommended,
125
+ {
126
+ rules: {
127
+ // We want to be able to use a single build system for most things.
128
+ // Ideally, we can use vite to build all project types so we don't
129
+ // have 4 different build systems across different projects. Thus
130
+ // we need to make sure that swc, esbuild, and tsc are supported.
131
+ // Forcing type imports ensures this.
132
+ "@typescript-eslint/consistent-type-imports": [
133
+ "error",
134
+ {
135
+ prefer: "type-imports"
136
+ }
137
+ ],
138
+ // There are times when any and legacy namespaces makes sense.
139
+ // If you use any kind of decorator library, you will almost
140
+ // be required to use any at some point. Forcing a non use of them
141
+ // means you're spending a bunch of time play type gymnastics and to
142
+ // hell with that.
143
+ "@typescript-eslint/no-explicit-any": "off",
144
+ "@typescript-eslint/no-namespace": "off",
145
+ // Would be fine, but there's a bug in this where you have a function with
146
+ // access arguments. Those constructors are often empty - so we want to let
147
+ // a part of this one through.
148
+ "no-empty-function": "off",
149
+ "@typescript-eslint/no-empty-function": [
150
+ "error",
151
+ {
152
+ allow: [
153
+ "constructors"
154
+ ]
155
+ }
156
+ ],
157
+ // A lot of 3rd party libraries still don't support esm
158
+ // and trying to force this right now just isn't feasible.
159
+ "@typescript-eslint/no-var-requires": "off",
160
+ "@typescript-eslint/no-require-imports": "off",
161
+ // I want aliasing support.
162
+ "@typescript-eslint/no-empty-object-type": "off",
163
+ "@typescript-eslint/no-empty-interface": "off",
164
+ // You will need unsafe declaration merging if you are doing anything
165
+ // with decorators as what often happens is that TypeScript cannot infer
166
+ // the output type of a decorator. So this has to be on to deal with
167
+ // TypeScripts shortcoming in this department. See
168
+ // https://github.com/microsoft/TypeScript/issues/4881 for more information.
169
+ "@typescript-eslint/no-unsafe-declaration-merging": "off",
170
+ // I can technically agree with this, but where this comes in
171
+ // handy is unit testing and I value that, so I want support
172
+ // to make the assumption that I know what I'm doing when
173
+ // I make a non-null assertion.
174
+ "@typescript-eslint/no-non-null-assertion": "off",
175
+ // This is actually fine, but this is broken in typescript eslint 8.14.x.
176
+ // See https://github.com/typescript-eslint/typescript-eslint/issues/10353
177
+ // for the bug.
178
+ "no-unused-expressions": "off",
179
+ "@typescript-eslint/no-unused-expressions": [
180
+ "error",
181
+ {
182
+ allowShortCircuit: false
183
+ }
184
+ ]
133
185
  }
134
- ]
135
186
  }
136
- }
137
187
  ];
188
+
138
189
  const recommended = [
139
- ...javascript,
140
- ...typescript,
141
- ...imports,
142
- ...prettier
190
+ ...javascript,
191
+ ...typescript,
192
+ ...imports,
193
+ ...prettier
143
194
  ];
144
- export {
145
- environments,
146
- imports,
147
- javascript,
148
- prettier,
149
- react,
150
- recommended,
151
- typescript
152
- };
195
+
196
+ export { environments, imports, javascript, prettier, react, recommended, typescript };
153
197
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/configs/environments.mts","../src/configs/imports.mts","../src/configs/javascript.mts","../src/configs/prettier.mts","../src/configs/react.mts","../src/configs/typescript.mts","../src/configs/recommended.mts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport globals from \"globals\";\n\nfunction environment(environment: object): Linter.Config {\n return {\n languageOptions: {\n globals: {\n ...environment,\n },\n },\n };\n}\n\nexport const environments = {\n browser: [environment(globals.browser)],\n node: [environment(globals.node), environment(globals.nodeBuiltin)],\n};\n","import type { Linter } from \"eslint\";\nimport _import from \"eslint-plugin-import\";\n\nexport const imports: Linter.Config[] = [\n _import.flatConfigs.recommended,\n {\n rules: {\n // This lint error is the main reason to use import as we want to make\n // sure we've installed our dependencies correctly.\n \"import/no-extraneous-dependencies\": \"error\",\n\n // These are straight up broken with Typescript when you need to work with\n // mts files that must have the file extension present. These can be fixed\n // using resolves, but it's such a pain and it's just not worth the hassle\n // for basic linting support. The no-extraneous-dependencies is really\n // the recommended config we want, so these being forced off are fine.\n \"import/named\": \"off\",\n \"import/no-unresolved\": \"off\",\n },\n } satisfies Linter.Config,\n];\n","import js from \"@eslint/js\";\nimport type { Linter } from \"eslint\";\n\nexport const javascript: Linter.Config[] = [\n js.configs.recommended,\n {\n rules: {\n // We want to support == null so we get a good check for undefined\n // or null\n eqeqeq: [\"error\", \"smart\"],\n // Would be fine, but there's a bug in this where you have a function with\n // access arguments. Those constructors are often empty - so we want to let\n // a part of this one through.\n \"no-empty-function\": \"off\",\n },\n },\n];\n","import pretty from \"eslint-plugin-prettier/recommended\";\n\nexport const prettier = [pretty];\n","import type { ESLint, Linter } from \"eslint\";\nimport _react from \"eslint-plugin-react\";\n\nexport const react: Linter.Config[] = [\n {\n files: [\"**/*.{js,cjs,mjs,ts,mts,jsx,tsx}\"],\n plugins: {\n react: _react as ESLint.Plugin,\n },\n languageOptions: {\n parserOptions: {\n ecmaFeatures: {\n jsx: true,\n },\n },\n },\n settings: {\n react: {\n version: \"detect\",\n },\n },\n rules: {\n // This one is not needed any longer as TypeScript jsx option\n // should be set to react-jsx. You will need to turn this on\n // manually if it is set to the legacy react setting. See\n // https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#whats-different-in-the-new-transform\n \"react/react-in-jsx-scope\": \"off\",\n },\n },\n];\n","import type { Linter } from \"eslint\";\nimport ts from \"typescript-eslint\";\n\nexport const typescript = [\n ...ts.configs.recommended,\n {\n rules: {\n // We want to be able to use a single build system for most things.\n // Ideally, we can use vite to build all project types so we don't\n // have 4 different build systems across different projects. Thus\n // we need to make sure that swc, esbuild, and tsc are supported.\n // Forcing type imports ensures this.\n \"@typescript-eslint/consistent-type-imports\": [\n \"error\",\n { prefer: \"type-imports\" },\n ],\n // There are times when any and legacy namespaces makes sense.\n // If you use any kind of decorator library, you will almost\n // be required to use any at some point. Forcing a non use of them\n // means you're spending a bunch of time play type gymnastics and to\n // hell with that.\n \"@typescript-eslint/no-explicit-any\": \"off\",\n \"@typescript-eslint/no-namespace\": \"off\",\n\n // Would be fine, but there's a bug in this where you have a function with\n // access arguments. Those constructors are often empty - so we want to let\n // a part of this one through.\n \"no-empty-function\": \"off\",\n \"@typescript-eslint/no-empty-function\": [\n \"error\",\n { allow: [\"constructors\"] },\n ],\n\n // A lot of 3rd party libraries still don't support esm\n // and trying to force this right now just isn't feasible.\n \"@typescript-eslint/no-var-requires\": \"off\",\n \"@typescript-eslint/no-require-imports\": \"off\",\n\n // I want aliasing support.\n \"@typescript-eslint/no-empty-object-type\": \"off\",\n \"@typescript-eslint/no-empty-interface\": \"off\",\n\n // You will need unsafe declaration merging if you are doing anything\n // with decorators as what often happens is that TypeScript cannot infer\n // the output type of a decorator. So this has to be on to deal with\n // TypeScripts shortcoming in this department. See\n // https://github.com/microsoft/TypeScript/issues/4881 for more information.\n \"@typescript-eslint/no-unsafe-declaration-merging\": \"off\",\n\n // I can technically agree with this, but where this comes in\n // handy is unit testing and I value that, so I want support\n // to make the assumption that I know what I'm doing when\n // I make a non-null assertion.\n \"@typescript-eslint/no-non-null-assertion\": \"off\",\n\n // This is actually fine, but this is broken in typescript eslint 8.14.x.\n // See https://github.com/typescript-eslint/typescript-eslint/issues/10353\n // for the bug.\n \"no-unused-expressions\": \"off\",\n \"@typescript-eslint/no-unused-expressions\": [\n \"error\",\n {\n allowShortCircuit: false,\n },\n ],\n },\n } satisfies Linter.Config,\n];\n","import { imports } from \"./imports.mjs\";\nimport { javascript } from \"./javascript.mjs\";\nimport { prettier } from \"./prettier.mjs\";\nimport { typescript } from \"./typescript.mjs\";\n\nexport const recommended = [\n ...javascript,\n ...typescript,\n ...imports,\n ...prettier,\n];\n"],"names":["environment"],"mappings":";;;;;;AAGA,SAAS,YAAYA,cAAoC;AAChD,SAAA;AAAA,IACL,iBAAiB;AAAA,MACf,SAAS;AAAA,QACP,GAAGA;AAAAA,MAAA;AAAA,IACL;AAAA,EAEJ;AACF;AAEO,MAAM,eAAe;AAAA,EAC1B,SAAS,CAAC,YAAY,QAAQ,OAAO,CAAC;AAAA,EACtC,MAAM,CAAC,YAAY,QAAQ,IAAI,GAAG,YAAY,QAAQ,WAAW,CAAC;AACpE;ACbO,MAAM,UAA2B;AAAA,EACtC,QAAQ,YAAY;AAAA,EACpB;AAAA,IACE,OAAO;AAAA;AAAA;AAAA,MAGL,qCAAqC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOrC,gBAAgB;AAAA,MAChB,wBAAwB;AAAA,IAAA;AAAA,EAC1B;AAEJ;ACjBO,MAAM,aAA8B;AAAA,EACzC,GAAG,QAAQ;AAAA,EACX;AAAA,IACE,OAAO;AAAA;AAAA;AAAA,MAGL,QAAQ,CAAC,SAAS,OAAO;AAAA;AAAA;AAAA;AAAA,MAIzB,qBAAqB;AAAA,IAAA;AAAA,EACvB;AAEJ;ACda,MAAA,WAAW,CAAC,MAAM;AC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":"index.js","sources":["../src/configs/environments.mts","../src/configs/imports.mts","../src/configs/javascript.mts","../src/configs/prettier.mts","../src/configs/react.mts","../src/configs/typescript.mts","../src/configs/recommended.mts"],"sourcesContent":["import type { Linter } from \"eslint\";\nimport globals from \"globals\";\n\nfunction environment(environment: object): Linter.Config {\n return {\n languageOptions: {\n globals: {\n ...environment,\n },\n },\n };\n}\n\nexport const environments = {\n browser: [environment(globals.browser)],\n node: [environment(globals.node), environment(globals.nodeBuiltin)],\n};\n","import type { Linter } from \"eslint\";\nimport _import from \"eslint-plugin-import\";\n\nexport const imports: Linter.Config[] = [\n _import.flatConfigs.recommended,\n {\n rules: {\n // This lint error is the main reason to use import as we want to make\n // sure we've installed our dependencies correctly.\n \"import/no-extraneous-dependencies\": \"error\",\n\n // These are straight up broken with Typescript when you need to work with\n // mts files that must have the file extension present. These can be fixed\n // using resolves, but it's such a pain and it's just not worth the hassle\n // for basic linting support. The no-extraneous-dependencies is really\n // the recommended config we want, so these being forced off are fine.\n \"import/named\": \"off\",\n \"import/no-unresolved\": \"off\",\n },\n } satisfies Linter.Config,\n];\n","import js from \"@eslint/js\";\nimport type { Linter } from \"eslint\";\n\nexport const javascript: Linter.Config[] = [\n js.configs.recommended,\n {\n rules: {\n // We want to support == null so we get a good check for undefined\n // or null\n eqeqeq: [\"error\", \"smart\"],\n // Would be fine, but there's a bug in this where you have a function with\n // access arguments. Those constructors are often empty - so we want to let\n // a part of this one through.\n \"no-empty-function\": \"off\",\n },\n },\n];\n","import pretty from \"eslint-plugin-prettier/recommended\";\n\nexport const prettier = [pretty];\n","import type { ESLint, Linter } from \"eslint\";\nimport _react from \"eslint-plugin-react\";\n\nexport const react: Linter.Config[] = [\n {\n files: [\"**/*.{js,cjs,mjs,ts,mts,jsx,tsx}\"],\n plugins: {\n react: _react as ESLint.Plugin,\n },\n languageOptions: {\n parserOptions: {\n ecmaFeatures: {\n jsx: true,\n },\n },\n },\n settings: {\n react: {\n version: \"detect\",\n },\n },\n rules: {\n // This one is not needed any longer as TypeScript jsx option\n // should be set to react-jsx. You will need to turn this on\n // manually if it is set to the legacy react setting. See\n // https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#whats-different-in-the-new-transform\n \"react/react-in-jsx-scope\": \"off\",\n },\n },\n];\n","import type { Linter } from \"eslint\";\nimport ts from \"typescript-eslint\";\n\nexport const typescript = [\n ...ts.configs.recommended,\n {\n rules: {\n // We want to be able to use a single build system for most things.\n // Ideally, we can use vite to build all project types so we don't\n // have 4 different build systems across different projects. Thus\n // we need to make sure that swc, esbuild, and tsc are supported.\n // Forcing type imports ensures this.\n \"@typescript-eslint/consistent-type-imports\": [\n \"error\",\n { prefer: \"type-imports\" },\n ],\n // There are times when any and legacy namespaces makes sense.\n // If you use any kind of decorator library, you will almost\n // be required to use any at some point. Forcing a non use of them\n // means you're spending a bunch of time play type gymnastics and to\n // hell with that.\n \"@typescript-eslint/no-explicit-any\": \"off\",\n \"@typescript-eslint/no-namespace\": \"off\",\n\n // Would be fine, but there's a bug in this where you have a function with\n // access arguments. Those constructors are often empty - so we want to let\n // a part of this one through.\n \"no-empty-function\": \"off\",\n \"@typescript-eslint/no-empty-function\": [\n \"error\",\n { allow: [\"constructors\"] },\n ],\n\n // A lot of 3rd party libraries still don't support esm\n // and trying to force this right now just isn't feasible.\n \"@typescript-eslint/no-var-requires\": \"off\",\n \"@typescript-eslint/no-require-imports\": \"off\",\n\n // I want aliasing support.\n \"@typescript-eslint/no-empty-object-type\": \"off\",\n \"@typescript-eslint/no-empty-interface\": \"off\",\n\n // You will need unsafe declaration merging if you are doing anything\n // with decorators as what often happens is that TypeScript cannot infer\n // the output type of a decorator. So this has to be on to deal with\n // TypeScripts shortcoming in this department. See\n // https://github.com/microsoft/TypeScript/issues/4881 for more information.\n \"@typescript-eslint/no-unsafe-declaration-merging\": \"off\",\n\n // I can technically agree with this, but where this comes in\n // handy is unit testing and I value that, so I want support\n // to make the assumption that I know what I'm doing when\n // I make a non-null assertion.\n \"@typescript-eslint/no-non-null-assertion\": \"off\",\n\n // This is actually fine, but this is broken in typescript eslint 8.14.x.\n // See https://github.com/typescript-eslint/typescript-eslint/issues/10353\n // for the bug.\n \"no-unused-expressions\": \"off\",\n \"@typescript-eslint/no-unused-expressions\": [\n \"error\",\n {\n allowShortCircuit: false,\n },\n ],\n },\n } satisfies Linter.Config,\n];\n","import { imports } from \"./imports.mjs\";\nimport { javascript } from \"./javascript.mjs\";\nimport { prettier } from \"./prettier.mjs\";\nimport { typescript } from \"./typescript.mjs\";\n\nexport const recommended = [\n ...javascript,\n ...typescript,\n ...imports,\n ...prettier,\n];\n"],"names":["environment","languageOptions","globals","environments","browser","node","nodeBuiltin","imports","_import","flatConfigs","recommended","rules","javascript","js","configs","eqeqeq","prettier","pretty","react","files","plugins","_react","parserOptions","ecmaFeatures","jsx","settings","version","typescript","ts","prefer","allow","allowShortCircuit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,SAASA,YAAYA,WAAmB,EAAA;IACtC,OAAO;QACLC,eAAiB,EAAA;AACfC,YAAAA,OAAAA,EAAS,cACJF,CAAAA,EAAAA,EAAAA,WAAAA;AAEP;AACF,KAAA;AACF;MAEaG,YAAe,GAAA;IAC1BC,OAAS,EAAA;AAACJ,QAAAA,WAAAA,CAAYE,QAAQE,OAAO;AAAE,KAAA;IACvCC,IAAM,EAAA;AAACL,QAAAA,WAAAA,CAAYE,QAAQG,IAAI,CAAA;AAAGL,QAAAA,WAAAA,CAAYE,QAAQI,WAAW;AAAE;AACrE;;MCbaC,OAA2B,GAAA;IACtCC,OAAQC,CAAAA,WAAW,CAACC,WAAW;AAC/B,IAAA;QACEC,KAAO,EAAA;;;YAGL,mCAAqC,EAAA,OAAA;;;;;;YAOrC,cAAgB,EAAA,KAAA;YAChB,sBAAwB,EAAA;AAC1B;AACF;;;MChBWC,UAA8B,GAAA;IACzCC,EAAGC,CAAAA,OAAO,CAACJ,WAAW;AACtB,IAAA;Q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A;AACtBE,IAAAA,GAAAA,UAAAA;AACAe,IAAAA,GAAAA,UAAAA;AACApB,IAAAA,GAAAA,OAAAA;AACAS,IAAAA,GAAAA;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zthun/janitor-eslint-config",
3
- "version": "19.2.0",
3
+ "version": "19.2.2",
4
4
  "description": "A shared configuration for eslint for @zthun scoped projects.",
5
5
  "keywords": [
6
6
  "eslint",
@@ -28,17 +28,17 @@
28
28
  "dist"
29
29
  ],
30
30
  "dependencies": {
31
- "@eslint/js": "^9.28.0",
31
+ "@eslint/js": "^9.29.0",
32
32
  "eslint-config-prettier": "^10.1.5",
33
33
  "eslint-plugin-import": "^2.31.0",
34
- "eslint-plugin-prettier": "^5.4.1",
34
+ "eslint-plugin-prettier": "^5.5.0",
35
35
  "eslint-plugin-react": "^7.37.5",
36
36
  "globals": "^16.2.0",
37
- "typescript-eslint": "^8.34.0"
37
+ "typescript-eslint": "^8.34.1"
38
38
  },
39
39
  "devDependencies": {
40
- "@zthun/janitor-build-config": "^19.2.0",
41
- "eslint": "^9.28.0",
40
+ "@zthun/janitor-build-config": "^19.2.2",
41
+ "eslint": "^9.29.0",
42
42
  "prettier": "^3.5.3",
43
43
  "typescript": "~5.8.3",
44
44
  "vite": "^6.3.5"
@@ -58,5 +58,5 @@
58
58
  "access": "public"
59
59
  },
60
60
  "author": "Anthony Bonta",
61
- "gitHead": "db77877e5b625c261b7d62f0d159b031fbda2e83"
61
+ "gitHead": "28f5ca31a2e299e343c3fd25163befa971f6a5e9"
62
62
  }