@zthun/janitor-eslint-config 19.4.3 → 19.5.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 +3 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -29
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -9,38 +9,12 @@ const pretty = require('eslint-plugin-prettier/recommended');
|
|
|
9
9
|
const _react = require('eslint-plugin-react');
|
|
10
10
|
const ts = require('typescript-eslint');
|
|
11
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;
|
|
22
|
-
}
|
|
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
12
|
function environment(environment) {
|
|
41
13
|
return {
|
|
42
14
|
languageOptions: {
|
|
43
|
-
globals:
|
|
15
|
+
globals: {
|
|
16
|
+
...environment
|
|
17
|
+
}
|
|
44
18
|
}
|
|
45
19
|
};
|
|
46
20
|
}
|
package/dist/index.cjs.map
CHANGED
|
@@ -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: Linter.Config[] = [\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":"
|
|
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: Linter.Config[] = [\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","allowSh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AAW;AACzB,IAAA;QACEC,KAAAA,EAAO;;;;;;YAML,4CAAA,EAA8C;AAC5C,gBAAA,OAAA;AACA,gBAAA;oBAAEkB,MAAAA,EAAQ;AAAe;AAC1B,aAAA;;;;;;YAMD,oCAAA,EAAsC,KAAA;YACtC,iCAAA,EAAmC,KAAA;;;;YAKnC,mBAAA,EAAqB,KAAA;YACrB,sCAAA,EAAwC;AACtC,gBAAA,OAAA;AACA,gBAAA;oBAAEC,KAAAA,EAAO;AAAC,wBAAA;AAAe;AAAC;AAC3B,aAAA;;;YAID,oCAAA,EAAsC,KAAA;YACtC,uCAAA,EAAyC,KAAA;;YAGzC,yCAAA,EAA2C,KAAA;YAC3C,uCAAA,EAAyC,KAAA;;;;;;YAOzC,kDAAA,EAAoD,KAAA;;;;;YAMpD,0CAAA,EAA4C,KAAA;;;;YAK5C,uBAAA,EAAyB,KAAA;YACzB,0CAAA,EAA4C;AAC1C,gBAAA,OAAA;AACA,gBAAA;oBACEC,iBAAAA,EAAmB;AACrB;AACD;AACH;AACF;;;MC7DWrB,WAAAA,GAAc;AACtBE,IAAAA,GAAAA,UAAAA;AACAe,IAAAA,GAAAA,UAAAA;AACApB,IAAAA,GAAAA,OAAAA;AACAS,IAAAA,GAAAA;;;;;;;;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -5,38 +5,12 @@ import pretty from 'eslint-plugin-prettier/recommended';
|
|
|
5
5
|
import _react from 'eslint-plugin-react';
|
|
6
6
|
import ts from 'typescript-eslint';
|
|
7
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;
|
|
18
|
-
}
|
|
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
8
|
function environment(environment) {
|
|
37
9
|
return {
|
|
38
10
|
languageOptions: {
|
|
39
|
-
globals:
|
|
11
|
+
globals: {
|
|
12
|
+
...environment
|
|
13
|
+
}
|
|
40
14
|
}
|
|
41
15
|
};
|
|
42
16
|
}
|
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: Linter.Config[] = [\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":"
|
|
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: Linter.Config[] = [\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,eAAAA,EAAiB;YACfC,OAAAA,EAAS;AACP,gBAAA,GAAGF;AACL;AACF;AACF,KAAA;AACF;MAEaG,YAAAA,GAAe;IAC1BC,OAAAA,EAAS;AAACJ,QAAAA,WAAAA,CAAYE,QAAQE,OAAO;AAAE,KAAA;IACvCC,IAAAA,EAAM;AAACL,QAAAA,WAAAA,CAAYE,QAAQG,IAAI,CAAA;AAAGL,QAAAA,WAAAA,CAAYE,QAAQI,WAAW;AAAE;AACrE;;MCbaC,OAAAA,GAA2B;IACtCC,OAAAA,CAAQC,WAAW,CAACC,WAAW;AAC/B,IAAA;QACEC,KAAAA,EAAO;;;YAGL,mCAAA,EAAqC,OAAA;;;;;;YAOrC,cAAA,EAAgB,KAAA;YAChB,sBAAA,EAAwB;AAC1B;AACF;;;MChBWC,UAAAA,GAA8B;IACzCC,EAAAA,CAAGC,OAAO,CAACJ,WAAW;AACtB,IAAA;QACEC,KAAAA,EAAO;;;YAGLI,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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.
|
|
3
|
+
"version": "19.5.1",
|
|
4
4
|
"description": "A shared configuration for eslint for @zthun scoped projects.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"typescript-eslint": "^8.47.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@zthun/janitor-build-config": "^19.
|
|
40
|
+
"@zthun/janitor-build-config": "^19.5.1",
|
|
41
41
|
"eslint": "^9.39.1",
|
|
42
42
|
"prettier": "^3.6.2",
|
|
43
43
|
"typescript": "~5.9.3",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"author": "Anthony Bonta",
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "8b2a09566d2d71c762189c7e94dcb1b8500f1863"
|
|
62
62
|
}
|