@zthun/janitor-eslint-config 19.0.0 → 19.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -128,6 +128,17 @@ const typescript = [
128
128
  ...ts.configs.recommended,
129
129
  {
130
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
+ ],
131
142
  // There are times when any and legacy namespaces makes sense.
132
143
  // If you use any kind of decorator library, you will almost
133
144
  // be required to use any at some point. Forcing a non use of them
@@ -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,QA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C,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","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,O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AAA;AACA,gBAAA;oBAAEC,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;;;MC7DWrB,WAAc,GAAA;AACtBE,IAAAA,GAAAA,UAAAA;AACAe,IAAAA,GAAAA,UAAAA;AACApB,IAAAA,GAAAA,OAAAA;AACAS,IAAAA,GAAAA;;;;;;;;;;;"}
package/dist/index.js CHANGED
@@ -124,6 +124,17 @@ const typescript = [
124
124
  ...ts.configs.recommended,
125
125
  {
126
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
+ ],
127
138
  // There are times when any and legacy namespaces makes sense.
128
139
  // If you use any kind of decorator library, you will almost
129
140
  // be required to use any at some point. Forcing a non use of them
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","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;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,4CAA8C,EAAA;AAC5C,gBAAA,OAAA;AACA,gBAAA;oBAAEkB,MAAQ,EAAA;AAAe;AAC1B,aAAA;;;;;;YAMD,oCAAsC,EAAA,KAAA;YACtC,iCAAmC,EAAA,KAAA;;;;YAKnC,mBAAqB,EAAA,KAAA;YACrB,sCAAwC,EAAA;AACtC,gBAAA,OAAA;AACA,gBAAA;oBAAEC,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;;;MC7DWrB,WAAc,GAAA;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.0.0",
3
+ "version": "19.1.0",
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.0",
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": "bffd8ac7224b5b19ac3e60a0f6a339a1d4e3a0e1"
62
62
  }