@zthun/janitor-eslint-config 19.0.0 → 19.1.1

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,191 +1,148 @@
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;
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
+ }
22
15
  }
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
- };
16
+ };
46
17
  }
47
18
  const environments = {
48
- browser: [
49
- environment(globals.browser)
50
- ],
51
- node: [
52
- environment(globals.node),
53
- environment(globals.nodeBuiltin)
54
- ]
19
+ browser: [environment(globals.browser)],
20
+ node: [environment(globals.node), environment(globals.nodeBuiltin)]
55
21
  };
56
-
57
22
  const imports = [
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
- }
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"
72
36
  }
37
+ }
73
38
  ];
74
-
75
39
  const javascript = [
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
- }
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"
90
50
  }
51
+ }
91
52
  ];
92
-
93
- const prettier = [
94
- pretty
95
- ];
96
-
53
+ const prettier = [pretty];
97
54
  const react = [
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"
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
123
64
  }
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"
124
78
  }
79
+ }
125
80
  ];
126
-
127
81
  const typescript = [
128
- ...ts.configs.recommended,
129
- {
130
- rules: {
131
- // There are times when any and legacy namespaces makes sense.
132
- // If you use any kind of decorator library, you will almost
133
- // be required to use any at some point. Forcing a non use of them
134
- // means you're spending a bunch of time play type gymnastics and to
135
- // hell with that.
136
- "@typescript-eslint/no-explicit-any": "off",
137
- "@typescript-eslint/no-namespace": "off",
138
- // Would be fine, but there's a bug in this where you have a function with
139
- // access arguments. Those constructors are often empty - so we want to let
140
- // a part of this one through.
141
- "no-empty-function": "off",
142
- "@typescript-eslint/no-empty-function": [
143
- "error",
144
- {
145
- allow: [
146
- "constructors"
147
- ]
148
- }
149
- ],
150
- // A lot of 3rd party libraries still don't support esm
151
- // and trying to force this right now just isn't feasible.
152
- "@typescript-eslint/no-var-requires": "off",
153
- "@typescript-eslint/no-require-imports": "off",
154
- // I want aliasing support.
155
- "@typescript-eslint/no-empty-object-type": "off",
156
- "@typescript-eslint/no-empty-interface": "off",
157
- // You will need unsafe declaration merging if you are doing anything
158
- // with decorators as what often happens is that TypeScript cannot infer
159
- // the output type of a decorator. So this has to be on to deal with
160
- // TypeScripts shortcoming in this department. See
161
- // https://github.com/microsoft/TypeScript/issues/4881 for more information.
162
- "@typescript-eslint/no-unsafe-declaration-merging": "off",
163
- // I can technically agree with this, but where this comes in
164
- // handy is unit testing and I value that, so I want support
165
- // to make the assumption that I know what I'm doing when
166
- // I make a non-null assertion.
167
- "@typescript-eslint/no-non-null-assertion": "off",
168
- // This is actually fine, but this is broken in typescript eslint 8.14.x.
169
- // See https://github.com/typescript-eslint/typescript-eslint/issues/10353
170
- // for the bug.
171
- "no-unused-expressions": "off",
172
- "@typescript-eslint/no-unused-expressions": [
173
- "error",
174
- {
175
- allowShortCircuit: false
176
- }
177
- ]
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
178
135
  }
136
+ ]
179
137
  }
138
+ }
180
139
  ];
181
-
182
140
  const recommended = [
183
- ...javascript,
184
- ...typescript,
185
- ...imports,
186
- ...prettier
141
+ ...javascript,
142
+ ...typescript,
143
+ ...imports,
144
+ ...prettier
187
145
  ];
188
-
189
146
  exports.environments = environments;
190
147
  exports.imports = imports;
191
148
  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 { 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 { 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 { 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 { 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 { Linter } from \"eslint\";\nimport ts from \"typescript-eslint\";\n\nexport const typescript = [\n ...ts.configs.recommended,\n {\n rules: {\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","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;QACEC,KAAO,EAAA;;;YAGLI,MAAQ,EAAA;AAAC,gBAAA,OAAA;AAAS,gBAAA;AAAQ,aAAA;;;;YAI1B,mBAAqB,EAAA;AACvB;AACF;;;MCbWC,QAAW,GAAA;AAACC,IAAAA;;;MCCZC,KAAyB,GAAA;AACpC,IAAA;QACEC,KAAO,EAAA;AAAC,YAAA;AAAmC,SAAA;QAC3CC,OAAS,EAAA;YACPF,KAAOG,EAAAA;AACT,SAAA;QACApB,eAAiB,EAAA;YACfqB,aAAe,EAAA;gBACbC,YAAc,EAAA;oBACZC,GAAK,EAAA;AACP;AACF;AACF,SAAA;QACAC,QAAU,EAAA;YACRP,KAAO,EAAA;gBACLQ,OAAS,EAAA;AACX;AACF,SAAA;QACAf,KAAO,EAAA;;;;;YAKL,0BAA4B,EAAA;AAC9B;AACF;;;MCzBWgB,UAAa,GAAA;OACrBC,EAAGd,CAAAA,OAAO,CAACJ,WAAW;AACzB,IAAA;QACEC,KAAO,EAAA;;;;;;YAML,oCAAsC,EAAA,KAAA;YACtC,iCAAmC,EAAA,KAAA;;;;YAKnC,mBAAqB,EAAA,KAAA;YACrB,sCAAwC,EAAA;AACtC,gBAAA,OAAA;AACA,gBAAA;oBAAEkB,KAAO,EAAA;AAAC,wBAAA;AAAe;AAAC;AAC3B,aAAA;;;YAID,oCAAsC,EAAA,KAAA;YACtC,uCAAyC,EAAA,KAAA;;YAGzC,yCAA2C,EAAA,KAAA;YAC3C,uCAAyC,EAAA,KAAA;;;;;;YAOzC,kDAAoD,EAAA,KAAA;;;;;YAMpD,0CAA4C,EAAA,KAAA;;;;YAK5C,uBAAyB,EAAA,KAAA;YACzB,0CAA4C,EAAA;AAC1C,gBAAA,OAAA;AACA,gBAAA;oBACEC,iBAAmB,EAAA;AACrB;AACD;AACH;AACF;;;MCpDWpB,WAAc,GAAA;AACtBE,IAAAA,GAAAA,UAAAA;AACAe,IAAAA,GAAAA,UAAAA;AACApB,IAAAA,GAAAA,OAAAA;AACAS,IAAAA,GAAAA;;;;;;;;;;;"}
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,MAAM;ACCxB,MAAM,QAAyB;AAAA,EACpC;AAAA,IACE,OAAO,CAAC,kCAAkC;AAAA,IAC1C,SAAS;AAAA,MACP,OAAO;AAAA,IACT;AAAA,IACA,iBAAiB;AAAA,MACf,eAAe;AAAA,QACb,cAAc;AAAA,UACZ,KAAK;AAAA,QAAA;AAAA,MACP;AAAA,IAEJ;AAAA,IACA,UAAU;AAAA,MACR,OAAO;AAAA,QACL,SAAS;AAAA,MAAA;AAAA,IAEb;AAAA,IACA,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,MAKL,4BAA4B;AAAA,IAAA;AAAA,EAC9B;AAEJ;AC1BO,MAAM,aAAa;AAAA,EACxB,GAAG,GAAG,QAAQ;AAAA,EACd;AAAA,IACE,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAML,8CAA8C;AAAA,QAC5C;AAAA,QACA,EAAE,QAAQ,eAAe;AAAA,MAC3B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMA,sCAAsC;AAAA,MACtC,mCAAmC;AAAA;AAAA;AAAA;AAAA,MAKnC,qBAAqB;AAAA,MACrB,wCAAwC;AAAA,QACtC;AAAA,QACA,EAAE,OAAO,CAAC,cAAc,EAAE;AAAA,MAC5B;AAAA;AAAA;AAAA,MAIA,sCAAsC;AAAA,MACtC,yCAAyC;AAAA;AAAA,MAGzC,2CAA2C;AAAA,MAC3C,yCAAyC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOzC,oDAAoD;AAAA;AAAA;AAAA;AAAA;AAAA,MAMpD,4CAA4C;AAAA;AAAA;AAAA;AAAA,MAK5C,yBAAyB;AAAA,MACzB,4CAA4C;AAAA,QAC1C;AAAA,QACA;AAAA,UACE,mBAAmB;AAAA,QAAA;AAAA,MACrB;AAAA,IACF;AAAA,EACF;AAEJ;AC9DO,MAAM,cAAc;AAAA,EACzB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;;;;;;;;"}
package/dist/index.js CHANGED
@@ -1,186 +1,153 @@
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;
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
+ }
18
13
  }
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
- };
14
+ };
42
15
  }
43
16
  const environments = {
44
- browser: [
45
- environment(globals.browser)
46
- ],
47
- node: [
48
- environment(globals.node),
49
- environment(globals.nodeBuiltin)
50
- ]
17
+ browser: [environment(globals.browser)],
18
+ node: [environment(globals.node), environment(globals.nodeBuiltin)]
51
19
  };
52
-
53
20
  const imports = [
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
- }
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"
68
34
  }
35
+ }
69
36
  ];
70
-
71
37
  const javascript = [
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
- }
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"
86
48
  }
49
+ }
87
50
  ];
88
-
89
- const prettier = [
90
- pretty
91
- ];
92
-
51
+ const prettier = [pretty];
93
52
  const react = [
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"
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
119
62
  }
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"
120
76
  }
77
+ }
121
78
  ];
122
-
123
79
  const typescript = [
124
- ...ts.configs.recommended,
125
- {
126
- rules: {
127
- // There are times when any and legacy namespaces makes sense.
128
- // If you use any kind of decorator library, you will almost
129
- // be required to use any at some point. Forcing a non use of them
130
- // means you're spending a bunch of time play type gymnastics and to
131
- // hell with that.
132
- "@typescript-eslint/no-explicit-any": "off",
133
- "@typescript-eslint/no-namespace": "off",
134
- // Would be fine, but there's a bug in this where you have a function with
135
- // access arguments. Those constructors are often empty - so we want to let
136
- // a part of this one through.
137
- "no-empty-function": "off",
138
- "@typescript-eslint/no-empty-function": [
139
- "error",
140
- {
141
- allow: [
142
- "constructors"
143
- ]
144
- }
145
- ],
146
- // A lot of 3rd party libraries still don't support esm
147
- // and trying to force this right now just isn't feasible.
148
- "@typescript-eslint/no-var-requires": "off",
149
- "@typescript-eslint/no-require-imports": "off",
150
- // I want aliasing support.
151
- "@typescript-eslint/no-empty-object-type": "off",
152
- "@typescript-eslint/no-empty-interface": "off",
153
- // You will need unsafe declaration merging if you are doing anything
154
- // with decorators as what often happens is that TypeScript cannot infer
155
- // the output type of a decorator. So this has to be on to deal with
156
- // TypeScripts shortcoming in this department. See
157
- // https://github.com/microsoft/TypeScript/issues/4881 for more information.
158
- "@typescript-eslint/no-unsafe-declaration-merging": "off",
159
- // I can technically agree with this, but where this comes in
160
- // handy is unit testing and I value that, so I want support
161
- // to make the assumption that I know what I'm doing when
162
- // I make a non-null assertion.
163
- "@typescript-eslint/no-non-null-assertion": "off",
164
- // This is actually fine, but this is broken in typescript eslint 8.14.x.
165
- // See https://github.com/typescript-eslint/typescript-eslint/issues/10353
166
- // for the bug.
167
- "no-unused-expressions": "off",
168
- "@typescript-eslint/no-unused-expressions": [
169
- "error",
170
- {
171
- allowShortCircuit: false
172
- }
173
- ]
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
174
133
  }
134
+ ]
175
135
  }
136
+ }
176
137
  ];
177
-
178
138
  const recommended = [
179
- ...javascript,
180
- ...typescript,
181
- ...imports,
182
- ...prettier
139
+ ...javascript,
140
+ ...typescript,
141
+ ...imports,
142
+ ...prettier
183
143
  ];
184
-
185
- export { environments, imports, javascript, prettier, react, recommended, typescript };
144
+ export {
145
+ environments,
146
+ imports,
147
+ javascript,
148
+ prettier,
149
+ react,
150
+ recommended,
151
+ typescript
152
+ };
186
153
  //# 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 { 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 { 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 { 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 { 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 { Linter } from \"eslint\";\nimport ts from \"typescript-eslint\";\n\nexport const typescript = [\n ...ts.configs.recommended,\n {\n rules: {\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","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;QACEC,KAAO,EAAA;;;YAGLI,MAAQ,EAAA;AAAC,gBAAA,OAAA;AAAS,gBAAA;AAAQ,aAAA;;;;YAI1B,mBAAqB,EAAA;AACvB;AACF;;;MCbWC,QAAW,GAAA;AAACC,IAAAA;;;MCCZC,KAAyB,GAAA;AACpC,IAAA;QACEC,KAAO,EAAA;AAAC,YAAA;AAAmC,SAAA;QAC3CC,OAAS,EAAA;YACPF,KAAOG,EAAAA;AACT,SAAA;QACApB,eAAiB,EAAA;YACfqB,aAAe,EAAA;gBACbC,YAAc,EAAA;oBACZC,GAAK,EAAA;AACP;AACF;AACF,SAAA;QACAC,QAAU,EAAA;YACRP,KAAO,EAAA;gBACLQ,OAAS,EAAA;AACX;AACF,SAAA;QACAf,KAAO,EAAA;;;;;YAKL,0BAA4B,EAAA;AAC9B;AACF;;;MCzBWgB,UAAa,GAAA;OACrBC,EAAGd,CAAAA,OAAO,CAACJ,WAAW;AACzB,IAAA;QACEC,KAAO,EAAA;;;;;;YAML,oCAAsC,EAAA,KAAA;YACtC,iCAAmC,EAAA,KAAA;;;;YAKnC,mBAAqB,EAAA,KAAA;YACrB,sCAAwC,EAAA;AACtC,gBAAA,OAAA;AACA,gBAAA;oBAAEkB,KAAO,EAAA;AAAC,wBAAA;AAAe;AAAC;AAC3B,aAAA;;;YAID,oCAAsC,EAAA,KAAA;YACtC,uCAAyC,EAAA,KAAA;;YAGzC,yCAA2C,EAAA,KAAA;YAC3C,uCAAyC,EAAA,KAAA;;;;;;YAOzC,kDAAoD,EAAA,KAAA;;;;;YAMpD,0CAA4C,EAAA,KAAA;;;;YAK5C,uBAAyB,EAAA,KAAA;YACzB,0CAA4C,EAAA;AAC1C,gBAAA,OAAA;AACA,gBAAA;oBACEC,iBAAmB,EAAA;AACrB;AACD;AACH;AACF;;;MCpDWpB,WAAc,GAAA;AACtBE,IAAAA,GAAAA,UAAAA;AACAe,IAAAA,GAAAA,UAAAA;AACApB,IAAAA,GAAAA,OAAAA;AACAS,IAAAA,GAAAA;;;;;"}
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;ACCxB,MAAM,QAAyB;AAAA,EACpC;AAAA,IACE,OAAO,CAAC,kCAAkC;AAAA,IAC1C,SAAS;AAAA,MACP,OAAO;AAAA,IACT;AAAA,IACA,iBAAiB;AAAA,MACf,eAAe;AAAA,QACb,cAAc;AAAA,UACZ,KAAK;AAAA,QAAA;AAAA,MACP;AAAA,IAEJ;AAAA,IACA,UAAU;AAAA,MACR,OAAO;AAAA,QACL,SAAS;AAAA,MAAA;AAAA,IAEb;AAAA,IACA,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,MAKL,4BAA4B;AAAA,IAAA;AAAA,EAC9B;AAEJ;AC1BO,MAAM,aAAa;AAAA,EACxB,GAAG,GAAG,QAAQ;AAAA,EACd;AAAA,IACE,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAML,8CAA8C;AAAA,QAC5C;AAAA,QACA,EAAE,QAAQ,eAAe;AAAA,MAC3B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMA,sCAAsC;AAAA,MACtC,mCAAmC;AAAA;AAAA;AAAA;AAAA,MAKnC,qBAAqB;AAAA,MACrB,wCAAwC;AAAA,QACtC;AAAA,QACA,EAAE,OAAO,CAAC,cAAc,EAAE;AAAA,MAC5B;AAAA;AAAA;AAAA,MAIA,sCAAsC;AAAA,MACtC,yCAAyC;AAAA;AAAA,MAGzC,2CAA2C;AAAA,MAC3C,yCAAyC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOzC,oDAAoD;AAAA;AAAA;AAAA;AAAA;AAAA,MAMpD,4CAA4C;AAAA;AAAA;AAAA;AAAA,MAK5C,yBAAyB;AAAA,MACzB,4CAA4C;AAAA,QAC1C;AAAA,QACA;AAAA,UACE,mBAAmB;AAAA,QAAA;AAAA,MACrB;AAAA,IACF;AAAA,EACF;AAEJ;AC9DO,MAAM,cAAc;AAAA,EACzB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zthun/janitor-eslint-config",
3
- "version": "19.0.0",
3
+ "version": "19.1.1",
4
4
  "description": "A shared configuration for eslint for @zthun scoped projects.",
5
5
  "keywords": [
6
6
  "eslint",
@@ -34,10 +34,10 @@
34
34
  "eslint-plugin-prettier": "^5.4.1",
35
35
  "eslint-plugin-react": "^7.37.5",
36
36
  "globals": "^16.2.0",
37
- "typescript-eslint": "^8.33.0"
37
+ "typescript-eslint": "^8.33.1"
38
38
  },
39
39
  "devDependencies": {
40
- "@zthun/janitor-build-config": "^19.0.0",
40
+ "@zthun/janitor-build-config": "^19.1.1",
41
41
  "eslint": "^9.28.0",
42
42
  "prettier": "^3.5.3",
43
43
  "typescript": "~5.8.3",
@@ -58,5 +58,5 @@
58
58
  "access": "public"
59
59
  },
60
60
  "author": "Anthony Bonta",
61
- "gitHead": "8277288093dff6023427448ccf903d83912865b5"
61
+ "gitHead": "ad805eb1111b858e833925d150acf12e48c09b1b"
62
62
  }