@aryaemami59/eslint-config 0.0.6 → 0.0.7
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 +10 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -17
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/disabledRules.ts +1 -1
- package/src/external.ts +4 -1
- package/src/globalIgnores.ts +3 -3
- package/src/globals.ts +1 -1
- package/src/index.ts +3 -0
- package/src/shareableConfigs.ts +10 -11
- package/src/utils.ts +3 -3
package/dist/index.cjs
CHANGED
|
@@ -32,8 +32,8 @@ let eslint_config_prettier_flat = require("eslint-config-prettier/flat");
|
|
|
32
32
|
eslint_config_prettier_flat = __toESM(eslint_config_prettier_flat);
|
|
33
33
|
let globals = require("globals");
|
|
34
34
|
globals = __toESM(globals);
|
|
35
|
-
let typescript_eslint = require("typescript-eslint");
|
|
36
35
|
let eslint_config = require("eslint/config");
|
|
36
|
+
let typescript_eslint = require("typescript-eslint");
|
|
37
37
|
|
|
38
38
|
//#region src/disabledRules.ts
|
|
39
39
|
/**
|
|
@@ -75,18 +75,6 @@ const { browser, node, nodeBuiltin, vitest } = globals.default;
|
|
|
75
75
|
//#region package.json
|
|
76
76
|
var name = "@aryaemami59/eslint-config";
|
|
77
77
|
|
|
78
|
-
//#endregion
|
|
79
|
-
//#region src/packageJsonName.ts
|
|
80
|
-
/**
|
|
81
|
-
* This is used because if we import the package name from the
|
|
82
|
-
* `package.json` file, it will be bundled into the final output,
|
|
83
|
-
* which is not desired.
|
|
84
|
-
*
|
|
85
|
-
* @since 0.0.5
|
|
86
|
-
* @internal
|
|
87
|
-
*/
|
|
88
|
-
const packageJsonName = name;
|
|
89
|
-
|
|
90
78
|
//#endregion
|
|
91
79
|
//#region src/globalIgnores.ts
|
|
92
80
|
/**
|
|
@@ -116,7 +104,7 @@ const globalIgnores = {
|
|
|
116
104
|
"**/dist/",
|
|
117
105
|
"**/temp/"
|
|
118
106
|
],
|
|
119
|
-
name: `${
|
|
107
|
+
name: `${name}/global-ignores`
|
|
120
108
|
};
|
|
121
109
|
|
|
122
110
|
//#endregion
|
|
@@ -226,7 +214,7 @@ const flatESLintConfig = [
|
|
|
226
214
|
reportUnusedDisableDirectives: 2,
|
|
227
215
|
reportUnusedInlineConfigs: 2
|
|
228
216
|
},
|
|
229
|
-
name: `${
|
|
217
|
+
name: `${name}/defaults/overrides`,
|
|
230
218
|
rules: {
|
|
231
219
|
"object-shorthand": [
|
|
232
220
|
2,
|
|
@@ -256,7 +244,7 @@ const flatESLintConfig = [
|
|
|
256
244
|
{
|
|
257
245
|
files: ["**/*.cjs"],
|
|
258
246
|
languageOptions: { sourceType: "commonjs" },
|
|
259
|
-
name: `${
|
|
247
|
+
name: `${name}/commonjs-files`,
|
|
260
248
|
rules: { "@typescript-eslint/no-require-imports": [0, {
|
|
261
249
|
allow: [],
|
|
262
250
|
allowAsImport: false
|
|
@@ -367,6 +355,12 @@ Object.defineProperty(exports, 'configs', {
|
|
|
367
355
|
}
|
|
368
356
|
});
|
|
369
357
|
exports.createESLintConfig = createESLintConfig;
|
|
358
|
+
Object.defineProperty(exports, 'defineConfig', {
|
|
359
|
+
enumerable: true,
|
|
360
|
+
get: function () {
|
|
361
|
+
return eslint_config.defineConfig;
|
|
362
|
+
}
|
|
363
|
+
});
|
|
370
364
|
exports.disabledRules = disabledRules;
|
|
371
365
|
exports.flatESLintConfig = flatESLintConfig;
|
|
372
366
|
exports.globalIgnores = globalIgnores;
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["globalIdentifiers","packageJson.name","globals","js","prettierConfig"],"sources":["../src/disabledRules.ts","../src/external.ts","../package.json","../src/packageJsonName.ts","../src/globalIgnores.ts","../src/globals.ts","../src/shareableConfigs.ts","../src/utils.ts"],"sourcesContent":["import type { Linter } from 'eslint'\n\n/**\n * An object comprised of ESLint rules to disable.\n * These rules are disabled in {@linkcode flatESLintConfig}.\n *\n * @since 0.0.3\n * @public\n */\nexport const disabledRules = {\n '@typescript-eslint/ban-ts-comment': [\n 0,\n {\n minimumDescriptionLength: 3,\n 'ts-check': false,\n 'ts-expect-error': 'allow-with-description',\n 'ts-ignore': true,\n 'ts-nocheck': true,\n },\n ],\n\n // TODO: Remove this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.\n '@typescript-eslint/consistent-generic-constructors': [0],\n\n '@typescript-eslint/no-unused-vars': [\n 0,\n {\n args: 'after-used',\n // Not included in default options\n argsIgnorePattern: '^_',\n caughtErrors: 'all',\n // Not included in default options\n caughtErrorsIgnorePattern: '^_',\n // Not included in default options\n destructuredArrayIgnorePattern: '^_',\n ignoreClassWithStaticInitBlock: false,\n ignoreRestSiblings: false,\n reportUsedIgnorePattern: false,\n vars: 'all',\n // Not included in default options\n varsIgnorePattern: '^_',\n },\n ],\n 'no-undef': [\n 0,\n {\n typeof: false,\n },\n ],\n} as const satisfies Linter.RulesRecord satisfies Record<\n keyof Linter.RulesRecord,\n [\n ruleSeverity: Extract<Linter.Severity, 0>,\n ...ruleOptions: readonly unknown[],\n ]\n>\n","import js from '@eslint/js'\nimport prettierConfig from 'eslint-config-prettier/flat'\nimport globalIdentifiers from 'globals'\nexport { config, configs, parser, plugin } from 'typescript-eslint'\nexport type {\n Config,\n ConfigArray,\n ConfigWithExtends,\n FlatConfig,\n InfiniteDepthConfigWithExtends,\n} from 'typescript-eslint'\nexport { js, prettierConfig }\nexport const { browser, node, nodeBuiltin, vitest } = globalIdentifiers\n","","import packageJson from '../package.json' with { type: 'json' }\n\n/**\n * This is used because if we import the package name from the\n * `package.json` file, it will be bundled into the final output,\n * which is not desired.\n *\n * @since 0.0.5\n * @internal\n */\nexport const packageJsonName = packageJson.name\n","import type { Config } from 'eslint/config'\nimport { packageJsonName } from './packageJsonName.js'\n\n/**\n * An object representing\n * {@link https://eslint.org/docs/latest/use/configure/ignore#ignoring-files | **global ignore patterns**}\n * for ESLint configuration.\n *\n * @since 0.0.3\n * @public\n */\nexport const globalIgnores = {\n ignores: [\n '**/__snapshots__/',\n '**/.docusaurus/',\n '**/.expo/',\n '**/.next/',\n '**/.playwright/',\n '**/.temp/',\n '**/.tmp/',\n '**/.turbo/',\n '**/.wrangler/',\n '**/.yalc/',\n '**/.yarn/',\n '**/*.snap',\n '**/build/',\n '**/coverage/',\n '**/dist/',\n '**/temp/',\n ],\n name: `${packageJsonName}/global-ignores`,\n} as const satisfies Config\n","import type { Linter } from 'eslint'\nimport { browser, node, nodeBuiltin, vitest } from './external.js'\n\n/**\n * An object representing the\n * {@link https://vitest.dev/config/#globals | globals} provided by\n * {@link https://vitest.dev | **Vitest**} for use in testing.\n *\n * @since 0.0.3\n * @public\n */\nexport const vitestGlobals = {\n afterAll: 'writable',\n afterEach: 'writable',\n assert: 'writable',\n assertType: 'writable',\n beforeAll: 'writable',\n beforeEach: 'writable',\n chai: 'writable',\n describe: 'writable',\n expect: 'writable',\n expectTypeOf: 'writable',\n it: 'writable',\n onTestFailed: 'writable',\n onTestFinished: 'writable',\n suite: 'writable',\n test: 'writable',\n vi: 'writable',\n vitest: 'writable',\n} as const satisfies Linter.Globals satisfies Record<\n keyof typeof vitest,\n Extract<Linter.GlobalConf, 'writable'>\n>\n\n/**\n * An object that specifies which global\n * variables are available during linting.\n *\n * @since 0.0.3\n * @public\n */\nexport const globals =\n /* @__PURE__ */\n Object.assign(\n {\n ...browser,\n ...node,\n ...nodeBuiltin,\n } as const satisfies Linter.Globals,\n\n {\n ...vitest,\n ...vitestGlobals,\n } as const satisfies Linter.Globals,\n ) satisfies Linter.Globals\n","import type { Linter } from 'eslint'\nimport { disabledRules } from './disabledRules.js'\nimport type { FlatConfig } from './external.js'\nimport { js, prettierConfig } from './external.js'\nimport { globalIgnores } from './globalIgnores.js'\nimport { globals } from './globals.js'\nimport { packageJsonName } from './packageJsonName.js'\n\n/**\n * Flat ESLint configuration tailored for projects using TypeScript.\n *\n * @example\n * <caption>#### __ECMAScript Modules (ESM) usage inside a file like `eslint.config.mts` or `eslint.config.mjs`__</caption>\n *\n * ```ts\n * import { flatESLintConfig } from '@aryaemami59/eslint-config'\n *\n * export default flatESLintConfig\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using `require`)__</caption>\n *\n * ```ts\n * const { flatESLintConfig } = require('@aryaemami59/eslint-config')\n *\n * module.exports = flatESLintConfig\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cjs` or `eslint.config.cts` (using dynamic import)__</caption>\n *\n * ```ts\n * module.exports = (async () =>\n * (await import('@aryaemami59/eslint-config')).flatESLintConfig)()\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` (using import and export assignment)__</caption>\n *\n * ```ts\n * import eslintConfigModule = require('@aryaemami59/eslint-config')\n * import flatESLintConfig = eslintConfigModule.flatESLintConfig\n *\n * export = flatESLintConfig\n * ```\n *\n * @since 0.0.3\n * @public\n */\nexport const flatESLintConfig = [\n // `ignores` must be first.\n // config with just `ignores` is the replacement for `.eslintignore`\n globalIgnores,\n\n {\n name: `${js.meta.name}/recommended`,\n ...js.configs.recommended,\n } as const satisfies FlatConfig.Config satisfies Linter.Config,\n\n // TODO: You can remove the type assertion in the next major version of `typescript-eslint`.\n // TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.\n // ...(configs.recommended satisfies Linter.Config[] as Linter.Config<any>[]),\n // TODO: You can remove the type assertion in the next major version of `typescript-eslint`.\n // TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.\n // ...(configs.stylistic satisfies Linter.Config[] as Linter.Config<any>[]),\n\n {\n languageOptions: {\n globals,\n parserOptions: {\n ecmaVersion: 'latest',\n projectService: true,\n } as const satisfies FlatConfig.ParserOptions satisfies Linter.ParserOptions,\n },\n linterOptions: {\n reportUnusedDisableDirectives: 2,\n reportUnusedInlineConfigs: 2,\n },\n name: `${packageJsonName}/defaults/overrides`,\n\n rules: {\n // TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.\n // '@typescript-eslint/consistent-type-definitions': [2, 'type'],\n // '@typescript-eslint/consistent-type-exports': [\n // 2,\n // { fixMixedExportsWithInlineTypeSpecifier: false },\n // ],\n // '@typescript-eslint/consistent-type-imports': [\n // 2,\n // {\n // disallowTypeAnnotations: true,\n // fixStyle: 'separate-type-imports',\n // prefer: 'type-imports',\n // },\n // ],\n // '@typescript-eslint/no-confusing-void-expression': [\n // 2,\n // {\n // ignoreArrowShorthand: false,\n // ignoreVoidOperator: false,\n // ignoreVoidReturningFunctions: false,\n // },\n // ],\n // '@typescript-eslint/no-duplicate-type-constituents': [\n // 2,\n // {\n // ignoreIntersections: false,\n // ignoreUnions: false,\n // },\n // ],\n // '@typescript-eslint/no-empty-object-type': [\n // 2,\n // {\n // allowInterfaces: 'never',\n // allowObjectTypes: 'never',\n // },\n // ],\n // '@typescript-eslint/no-explicit-any': [\n // 2,\n // {\n // fixToUnknown: false,\n // ignoreRestArgs: false,\n // },\n // ],\n // '@typescript-eslint/no-inferrable-types': [\n // 2,\n // {\n // ignoreParameters: false,\n // ignoreProperties: false,\n // },\n // ],\n // '@typescript-eslint/no-invalid-void-type': [\n // 2,\n // {\n // allowAsThisParameter: false,\n // allowInGenericTypeArguments: true,\n // },\n // ],\n // '@typescript-eslint/no-namespace': [\n // 2,\n // {\n // allowDeclarations: false,\n // allowDefinitionFiles: true,\n // },\n // ],\n // '@typescript-eslint/no-redundant-type-constituents': [2],\n // '@typescript-eslint/no-require-imports': [\n // 2,\n // {\n // allow: [],\n // allowAsImport: true,\n // },\n // ],\n // '@typescript-eslint/no-restricted-types': [\n // 2,\n // {\n // types: {\n // '{}': {\n // message: `\n // - If you want to represent an empty object, use \\`type EmptyObject = Record<string, never>\\`.\n // - If you want to represent an object literal, use either \\`type AnyObject = Record<string, any>\\` or \\`object\\`.\n // - If you want to represent any non-nullish value, use \\`type AnyNonNullishValue = NonNullable<unknown>\\`.`,\n // suggest: [\n // 'AnyNonNullishValue',\n // 'EmptyObject',\n // 'AnyObject',\n // 'object',\n // 'Record<string, never>',\n // 'Record<string, any>',\n // 'NonNullable<unknown>',\n // ],\n // },\n // },\n // },\n // ],\n // '@typescript-eslint/no-unnecessary-type-arguments': [2],\n // '@typescript-eslint/no-unnecessary-type-assertion': [\n // 2,\n // { typesToIgnore: [] },\n // ],\n // '@typescript-eslint/no-unnecessary-type-parameters': [2],\n // '@typescript-eslint/prefer-nullish-coalescing': [\n // 2,\n // {\n // allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,\n // ignoreBooleanCoercion: false,\n // ignoreConditionalTests: true,\n // ignoreIfStatements: false,\n // ignoreMixedLogicalExpressions: false,\n // ignorePrimitives: {\n // bigint: false,\n // boolean: false,\n // number: false,\n // string: false,\n // },\n // ignoreTernaryTests: false,\n // },\n // ],\n // '@typescript-eslint/require-await': [2],\n // '@typescript-eslint/unified-signatures': [\n // 2,\n // {\n // ignoreDifferentlyNamedParameters: false,\n // ignoreOverloadsWithDifferentJSDoc: false,\n // },\n // ],\n 'object-shorthand': [\n 2,\n 'always',\n {\n avoidExplicitReturnArrows: true,\n avoidQuotes: true,\n ignoreConstructors: true,\n methodsIgnorePattern: '',\n },\n ],\n 'sort-imports': [\n 2,\n {\n allowSeparatedGroups: true,\n ignoreCase: false,\n ignoreDeclarationSort: true,\n ignoreMemberSort: false,\n memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],\n },\n ],\n\n ...disabledRules,\n },\n } as const satisfies Linter.Config,\n\n {\n files: ['**/*.cjs'],\n languageOptions: {\n sourceType: 'commonjs',\n } as const satisfies FlatConfig.LanguageOptions satisfies Linter.LanguageOptions,\n name: `${packageJsonName}/commonjs-files`,\n rules: {\n '@typescript-eslint/no-require-imports': [\n 0,\n {\n allow: [],\n allowAsImport: false,\n },\n ],\n },\n } as const satisfies Linter.Config,\n\n prettierConfig,\n] as const satisfies Linter.Config[]\n","import type { Linter } from 'eslint'\nimport { defineConfig } from 'eslint/config'\nimport { flatESLintConfig } from './shareableConfigs.js'\n\n/**\n * A function that returns {@linkcode flatESLintConfig}\n * along with optional additional overrides.\n * It's made mainly to provide intellisense and eliminate\n * the need for manual type annotations using JSDoc comments.\n *\n * @param [additionalOverrides=[]] - **Optional** additional overrides to apply to the configuration.\n * @returns An augmented version of the default {@linkcode flatESLintConfig}, incorporating any provided overrides.\n *\n * @example\n * <caption>#### __ECMAScript Modules (ESM) usage inside a file like `eslint.config.mts` or `eslint.config.mjs`__</caption>\n *\n * ```ts\n * import { createESLintConfig } from '@aryaemami59/eslint-config'\n *\n * export default createESLintConfig([\n * {\n * rules: {\n * 'no-console': [0],\n * },\n * },\n * {\n * // ...Other additional overrides\n * },\n * ])\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using `require`)__</caption>\n *\n * ```ts\n * const { createESLintConfig } = require('@aryaemami59/eslint-config')\n *\n * module.exports = createESLintConfig([\n * {\n * rules: {\n * 'no-console': [0],\n * },\n * },\n * {\n * // ...Other additional overrides\n * },\n * ])\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using dynamic import)__</caption>\n *\n * ```ts\n * module.exports = (async () =>\n * (await import('@aryaemami59/eslint-config')).createESLintConfig([\n * {\n * rules: {\n * 'no-console': [0],\n * },\n * },\n * {\n * // ...Other additional overrides\n * },\n * ]))()\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` (using import and export assignment)__</caption>\n *\n * ```ts\n * import eslintConfigModule = require('@aryaemami59/eslint-config')\n * import createESLintConfig = eslintConfigModule.createESLintConfig\n *\n * export = createESLintConfig([\n * {\n * rules: {\n * 'no-console': [0],\n * },\n * },\n * {\n * // ...Other additional overrides\n * },\n * ])\n * ```\n *\n * @since 0.0.3\n * @public\n */\nexport const createESLintConfig = (\n additionalOverrides: Parameters<typeof defineConfig> = [],\n): Linter.Config[] =>\n /* @__PURE__ */ defineConfig(...flatESLintConfig, ...additionalOverrides)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAa,gBAAgB;CAC3B,qCAAqC,CACnC,GACA;EACE,0BAA0B;EAC1B,YAAY;EACZ,mBAAmB;EACnB,aAAa;EACb,cAAc;EACf,CACF;CAGD,sDAAsD,CAAC,EAAE;CAEzD,qCAAqC,CACnC,GACA;EACE,MAAM;EAEN,mBAAmB;EACnB,cAAc;EAEd,2BAA2B;EAE3B,gCAAgC;EAChC,gCAAgC;EAChC,oBAAoB;EACpB,yBAAyB;EACzB,MAAM;EAEN,mBAAmB;EACpB,CACF;CACD,YAAY,CACV,GACA,EACE,QAAQ,OACT,CACF;CACF;;;;ACrCD,MAAa,EAAE,SAAS,MAAM,aAAa,WAAWA;;;;;;;;;;;;;;;;AEFtD,MAAa,kBAAkBC;;;;;;;;;;;;ACC/B,MAAa,gBAAgB;CAC3B,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,MAAM,GAAG,gBAAgB;CAC1B;;;;;;;;;;;;ACpBD,MAAa,gBAAgB;CAC3B,UAAU;CACV,WAAW;CACX,QAAQ;CACR,YAAY;CACZ,WAAW;CACX,YAAY;CACZ,MAAM;CACN,UAAU;CACV,QAAQ;CACR,cAAc;CACd,IAAI;CACJ,cAAc;CACd,gBAAgB;CAChB,OAAO;CACP,MAAM;CACN,IAAI;CACJ,QAAQ;CACT;;;;;;;;AAYD,MAAaC,YAEX,uBAAO,OACL;CACE,GAAG;CACH,GAAG;CACH,GAAG;CACJ,EAED;CACE,GAAG;CACH,GAAG;CACJ,CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACJH,MAAa,mBAAmB;CAG9B;CAEA;EACE,MAAM,GAAGC,mBAAG,KAAK,KAAK;EACtB,GAAGA,mBAAG,QAAQ;EACf;CASD;EACE,iBAAiB;GACf;GACA,eAAe;IACb,aAAa;IACb,gBAAgB;IACjB;GACF;EACD,eAAe;GACb,+BAA+B;GAC/B,2BAA2B;GAC5B;EACD,MAAM,GAAG,gBAAgB;EAEzB,OAAO;GA8HL,oBAAoB;IAClB;IACA;IACA;KACE,2BAA2B;KAC3B,aAAa;KACb,oBAAoB;KACpB,sBAAsB;KACvB;IACF;GACD,gBAAgB,CACd,GACA;IACE,sBAAsB;IACtB,YAAY;IACZ,uBAAuB;IACvB,kBAAkB;IAClB,uBAAuB;KAAC;KAAQ;KAAO;KAAY;KAAS;IAC7D,CACF;GAED,GAAG;GACJ;EACF;CAED;EACE,OAAO,CAAC,WAAW;EACnB,iBAAiB,EACf,YAAY,YACb;EACD,MAAM,GAAG,gBAAgB;EACzB,OAAO,EACL,yCAAyC,CACvC,GACA;GACE,OAAO,EAAE;GACT,eAAe;GAChB,CACF,EACF;EACF;CAEDC;CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClKD,MAAa,sBACX,sBAAuD,EAAE,KAEzC,gDAAa,GAAG,kBAAkB,GAAG,oBAAoB"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["globalIdentifiers","packageJson.name","globals","js","packageJson.name","prettierConfig"],"sources":["../src/disabledRules.ts","../src/external.ts","../package.json","../src/globalIgnores.ts","../src/globals.ts","../src/shareableConfigs.ts","../src/utils.ts"],"sourcesContent":["import type { Linter } from './external.js'\n\n/**\n * An object comprised of ESLint rules to disable.\n * These rules are disabled in {@linkcode flatESLintConfig}.\n *\n * @since 0.0.3\n * @public\n */\nexport const disabledRules = {\n '@typescript-eslint/ban-ts-comment': [\n 0,\n {\n minimumDescriptionLength: 3,\n 'ts-check': false,\n 'ts-expect-error': 'allow-with-description',\n 'ts-ignore': true,\n 'ts-nocheck': true,\n },\n ],\n\n // TODO: Remove this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.\n '@typescript-eslint/consistent-generic-constructors': [0],\n\n '@typescript-eslint/no-unused-vars': [\n 0,\n {\n args: 'after-used',\n // Not included in default options\n argsIgnorePattern: '^_',\n caughtErrors: 'all',\n // Not included in default options\n caughtErrorsIgnorePattern: '^_',\n // Not included in default options\n destructuredArrayIgnorePattern: '^_',\n ignoreClassWithStaticInitBlock: false,\n ignoreRestSiblings: false,\n reportUsedIgnorePattern: false,\n vars: 'all',\n // Not included in default options\n varsIgnorePattern: '^_',\n },\n ],\n 'no-undef': [\n 0,\n {\n typeof: false,\n },\n ],\n} as const satisfies Linter.RulesRecord satisfies Record<\n keyof Linter.RulesRecord,\n [\n ruleSeverity: Extract<Linter.Severity, 0>,\n ...ruleOptions: readonly unknown[],\n ]\n>\n","import js from '@eslint/js'\nimport prettierConfig from 'eslint-config-prettier/flat'\nimport globalIdentifiers from 'globals'\nexport type { Linter } from 'eslint'\nexport { defineConfig } from 'eslint/config'\nexport type { Config } from 'eslint/config'\nexport { config, configs, parser, plugin } from 'typescript-eslint'\nexport type {\n ConfigArray,\n ConfigWithExtends,\n FlatConfig,\n InfiniteDepthConfigWithExtends,\n Config as TSESlintConfig,\n} from 'typescript-eslint'\nexport { js, prettierConfig }\nexport const { browser, node, nodeBuiltin, vitest } = globalIdentifiers\n","","import packageJson from '../package.json' with { type: 'json' }\nimport type { Config } from './external.js'\n\n/**\n * An object representing\n * {@link https://eslint.org/docs/latest/use/configure/ignore#ignoring-files | **global ignore patterns**}\n * for ESLint configuration.\n *\n * @since 0.0.3\n * @public\n */\nexport const globalIgnores = {\n ignores: [\n '**/__snapshots__/',\n '**/.docusaurus/',\n '**/.expo/',\n '**/.next/',\n '**/.playwright/',\n '**/.temp/',\n '**/.tmp/',\n '**/.turbo/',\n '**/.wrangler/',\n '**/.yalc/',\n '**/.yarn/',\n '**/*.snap',\n '**/build/',\n '**/coverage/',\n '**/dist/',\n '**/temp/',\n ],\n name: `${packageJson.name}/global-ignores`,\n} as const satisfies Config\n","import type { Linter } from './external.js'\nimport { browser, node, nodeBuiltin, vitest } from './external.js'\n\n/**\n * An object representing the\n * {@link https://vitest.dev/config/#globals | globals} provided by\n * {@link https://vitest.dev | **Vitest**} for use in testing.\n *\n * @since 0.0.3\n * @public\n */\nexport const vitestGlobals = {\n afterAll: 'writable',\n afterEach: 'writable',\n assert: 'writable',\n assertType: 'writable',\n beforeAll: 'writable',\n beforeEach: 'writable',\n chai: 'writable',\n describe: 'writable',\n expect: 'writable',\n expectTypeOf: 'writable',\n it: 'writable',\n onTestFailed: 'writable',\n onTestFinished: 'writable',\n suite: 'writable',\n test: 'writable',\n vi: 'writable',\n vitest: 'writable',\n} as const satisfies Linter.Globals satisfies Record<\n keyof typeof vitest,\n Extract<Linter.GlobalConf, 'writable'>\n>\n\n/**\n * An object that specifies which global\n * variables are available during linting.\n *\n * @since 0.0.3\n * @public\n */\nexport const globals =\n /* @__PURE__ */\n Object.assign(\n {\n ...browser,\n ...node,\n ...nodeBuiltin,\n } as const satisfies Linter.Globals,\n\n {\n ...vitest,\n ...vitestGlobals,\n } as const satisfies Linter.Globals,\n ) satisfies Linter.Globals\n","import packageJson from '../package.json' with { type: 'json' }\nimport { disabledRules } from './disabledRules.js'\nimport type { Config, FlatConfig, Linter } from './external.js'\nimport { js, prettierConfig } from './external.js'\nimport { globalIgnores } from './globalIgnores.js'\nimport { globals } from './globals.js'\n\n/**\n * Flat ESLint configuration tailored for projects using TypeScript.\n *\n * @example\n * <caption>#### __ECMAScript Modules (ESM) usage inside a file like `eslint.config.mts` or `eslint.config.mjs`__</caption>\n *\n * ```ts\n * import { flatESLintConfig } from '@aryaemami59/eslint-config'\n *\n * export default flatESLintConfig\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using `require`)__</caption>\n *\n * ```ts\n * const { flatESLintConfig } = require('@aryaemami59/eslint-config')\n *\n * module.exports = flatESLintConfig\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cjs` or `eslint.config.cts` (using dynamic import)__</caption>\n *\n * ```ts\n * module.exports = (async () =>\n * (await import('@aryaemami59/eslint-config')).flatESLintConfig)()\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` (using import and export assignment)__</caption>\n *\n * ```ts\n * import eslintConfigModule = require('@aryaemami59/eslint-config')\n * import flatESLintConfig = eslintConfigModule.flatESLintConfig\n *\n * export = flatESLintConfig\n * ```\n *\n * @since 0.0.3\n * @public\n */\nexport const flatESLintConfig = [\n // `ignores` must be first.\n // config with just `ignores` is the replacement for `.eslintignore`\n globalIgnores,\n\n {\n name: `${js.meta.name}/recommended`,\n ...js.configs.recommended,\n } as const satisfies FlatConfig.Config satisfies Config,\n\n // TODO: You can remove the type assertion in the next major version of `typescript-eslint`.\n // TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.\n // ...(configs.recommended satisfies Config[] as Config<any>[]),\n // TODO: You can remove the type assertion in the next major version of `typescript-eslint`.\n // TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.\n // ...(configs.stylistic satisfies Config[] as Config<any>[]),\n\n {\n languageOptions: {\n globals,\n parserOptions: {\n ecmaVersion: 'latest',\n projectService: true,\n } as const satisfies FlatConfig.ParserOptions satisfies Linter.ParserOptions,\n },\n linterOptions: {\n reportUnusedDisableDirectives: 2,\n reportUnusedInlineConfigs: 2,\n },\n name: `${packageJson.name}/defaults/overrides`,\n\n rules: {\n // TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.\n // '@typescript-eslint/consistent-type-definitions': [2, 'type'],\n // '@typescript-eslint/consistent-type-exports': [\n // 2,\n // { fixMixedExportsWithInlineTypeSpecifier: false },\n // ],\n // '@typescript-eslint/consistent-type-imports': [\n // 2,\n // {\n // disallowTypeAnnotations: true,\n // fixStyle: 'separate-type-imports',\n // prefer: 'type-imports',\n // },\n // ],\n // '@typescript-eslint/no-confusing-void-expression': [\n // 2,\n // {\n // ignoreArrowShorthand: false,\n // ignoreVoidOperator: false,\n // ignoreVoidReturningFunctions: false,\n // },\n // ],\n // '@typescript-eslint/no-duplicate-type-constituents': [\n // 2,\n // {\n // ignoreIntersections: false,\n // ignoreUnions: false,\n // },\n // ],\n // '@typescript-eslint/no-empty-object-type': [\n // 2,\n // {\n // allowInterfaces: 'never',\n // allowObjectTypes: 'never',\n // },\n // ],\n // '@typescript-eslint/no-explicit-any': [\n // 2,\n // {\n // fixToUnknown: false,\n // ignoreRestArgs: false,\n // },\n // ],\n // '@typescript-eslint/no-inferrable-types': [\n // 2,\n // {\n // ignoreParameters: false,\n // ignoreProperties: false,\n // },\n // ],\n // '@typescript-eslint/no-invalid-void-type': [\n // 2,\n // {\n // allowAsThisParameter: false,\n // allowInGenericTypeArguments: true,\n // },\n // ],\n // '@typescript-eslint/no-namespace': [\n // 2,\n // {\n // allowDeclarations: false,\n // allowDefinitionFiles: true,\n // },\n // ],\n // '@typescript-eslint/no-redundant-type-constituents': [2],\n // '@typescript-eslint/no-require-imports': [\n // 2,\n // {\n // allow: [],\n // allowAsImport: true,\n // },\n // ],\n // '@typescript-eslint/no-restricted-types': [\n // 2,\n // {\n // types: {\n // '{}': {\n // message: `\n // - If you want to represent an empty object, use \\`type EmptyObject = Record<string, never>\\`.\n // - If you want to represent an object literal, use either \\`type AnyObject = Record<string, any>\\` or \\`object\\`.\n // - If you want to represent any non-nullish value, use \\`type AnyNonNullishValue = NonNullable<unknown>\\`.`,\n // suggest: [\n // 'AnyNonNullishValue',\n // 'EmptyObject',\n // 'AnyObject',\n // 'object',\n // 'Record<string, never>',\n // 'Record<string, any>',\n // 'NonNullable<unknown>',\n // ],\n // },\n // },\n // },\n // ],\n // '@typescript-eslint/no-unnecessary-type-arguments': [2],\n // '@typescript-eslint/no-unnecessary-type-assertion': [\n // 2,\n // { typesToIgnore: [] },\n // ],\n // '@typescript-eslint/no-unnecessary-type-parameters': [2],\n // '@typescript-eslint/prefer-nullish-coalescing': [\n // 2,\n // {\n // allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,\n // ignoreBooleanCoercion: false,\n // ignoreConditionalTests: true,\n // ignoreIfStatements: false,\n // ignoreMixedLogicalExpressions: false,\n // ignorePrimitives: {\n // bigint: false,\n // boolean: false,\n // number: false,\n // string: false,\n // },\n // ignoreTernaryTests: false,\n // },\n // ],\n // '@typescript-eslint/require-await': [2],\n // '@typescript-eslint/unified-signatures': [\n // 2,\n // {\n // ignoreDifferentlyNamedParameters: false,\n // ignoreOverloadsWithDifferentJSDoc: false,\n // },\n // ],\n 'object-shorthand': [\n 2,\n 'always',\n {\n avoidExplicitReturnArrows: true,\n avoidQuotes: true,\n ignoreConstructors: true,\n methodsIgnorePattern: '',\n },\n ],\n 'sort-imports': [\n 2,\n {\n allowSeparatedGroups: true,\n ignoreCase: false,\n ignoreDeclarationSort: true,\n ignoreMemberSort: false,\n memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],\n },\n ],\n\n ...disabledRules,\n },\n } as const satisfies Config,\n\n {\n files: ['**/*.cjs'],\n languageOptions: {\n sourceType: 'commonjs',\n } as const satisfies FlatConfig.LanguageOptions satisfies Linter.LanguageOptions,\n name: `${packageJson.name}/commonjs-files`,\n rules: {\n '@typescript-eslint/no-require-imports': [\n 0,\n {\n allow: [],\n allowAsImport: false,\n },\n ],\n },\n } as const satisfies Config,\n\n prettierConfig,\n] as const satisfies Config[]\n","import type { Config } from './external.js'\nimport { defineConfig } from './external.js'\nimport { flatESLintConfig } from './shareableConfigs.js'\n\n/**\n * A function that returns {@linkcode flatESLintConfig}\n * along with optional additional overrides.\n * It's made mainly to provide intellisense and eliminate\n * the need for manual type annotations using JSDoc comments.\n *\n * @param [additionalOverrides=[]] - **Optional** additional overrides to apply to the configuration.\n * @returns An augmented version of the default {@linkcode flatESLintConfig}, incorporating any provided overrides.\n *\n * @example\n * <caption>#### __ECMAScript Modules (ESM) usage inside a file like `eslint.config.mts` or `eslint.config.mjs`__</caption>\n *\n * ```ts\n * import { createESLintConfig } from '@aryaemami59/eslint-config'\n *\n * export default createESLintConfig([\n * {\n * rules: {\n * 'no-console': [0],\n * },\n * },\n * {\n * // ...Other additional overrides\n * },\n * ])\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using `require`)__</caption>\n *\n * ```ts\n * const { createESLintConfig } = require('@aryaemami59/eslint-config')\n *\n * module.exports = createESLintConfig([\n * {\n * rules: {\n * 'no-console': [0],\n * },\n * },\n * {\n * // ...Other additional overrides\n * },\n * ])\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using dynamic import)__</caption>\n *\n * ```ts\n * module.exports = (async () =>\n * (await import('@aryaemami59/eslint-config')).createESLintConfig([\n * {\n * rules: {\n * 'no-console': [0],\n * },\n * },\n * {\n * // ...Other additional overrides\n * },\n * ]))()\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` (using import and export assignment)__</caption>\n *\n * ```ts\n * import eslintConfigModule = require('@aryaemami59/eslint-config')\n * import createESLintConfig = eslintConfigModule.createESLintConfig\n *\n * export = createESLintConfig([\n * {\n * rules: {\n * 'no-console': [0],\n * },\n * },\n * {\n * // ...Other additional overrides\n * },\n * ])\n * ```\n *\n * @since 0.0.3\n * @public\n */\nexport const createESLintConfig = (\n additionalOverrides: Parameters<typeof defineConfig> = [],\n): Config[] =>\n /* @__PURE__ */ defineConfig(...flatESLintConfig, ...additionalOverrides)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAa,gBAAgB;CAC3B,qCAAqC,CACnC,GACA;EACE,0BAA0B;EAC1B,YAAY;EACZ,mBAAmB;EACnB,aAAa;EACb,cAAc;EACf,CACF;CAGD,sDAAsD,CAAC,EAAE;CAEzD,qCAAqC,CACnC,GACA;EACE,MAAM;EAEN,mBAAmB;EACnB,cAAc;EAEd,2BAA2B;EAE3B,gCAAgC;EAChC,gCAAgC;EAChC,oBAAoB;EACpB,yBAAyB;EACzB,MAAM;EAEN,mBAAmB;EACpB,CACF;CACD,YAAY,CACV,GACA,EACE,QAAQ,OACT,CACF;CACF;;;;AClCD,MAAa,EAAE,SAAS,MAAM,aAAa,WAAWA;;;;;;;;;;;;;;;;AEJtD,MAAa,gBAAgB;CAC3B,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,MAAM,GAAGC,KAAiB;CAC3B;;;;;;;;;;;;ACpBD,MAAa,gBAAgB;CAC3B,UAAU;CACV,WAAW;CACX,QAAQ;CACR,YAAY;CACZ,WAAW;CACX,YAAY;CACZ,MAAM;CACN,UAAU;CACV,QAAQ;CACR,cAAc;CACd,IAAI;CACJ,cAAc;CACd,gBAAgB;CAChB,OAAO;CACP,MAAM;CACN,IAAI;CACJ,QAAQ;CACT;;;;;;;;AAYD,MAAaC,YAEX,uBAAO,OACL;CACE,GAAG;CACH,GAAG;CACH,GAAG;CACJ,EAED;CACE,GAAG;CACH,GAAG;CACJ,CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACLH,MAAa,mBAAmB;CAG9B;CAEA;EACE,MAAM,GAAGC,mBAAG,KAAK,KAAK;EACtB,GAAGA,mBAAG,QAAQ;EACf;CASD;EACE,iBAAiB;GACf;GACA,eAAe;IACb,aAAa;IACb,gBAAgB;IACjB;GACF;EACD,eAAe;GACb,+BAA+B;GAC/B,2BAA2B;GAC5B;EACD,MAAM,GAAGC,KAAiB;EAE1B,OAAO;GA8HL,oBAAoB;IAClB;IACA;IACA;KACE,2BAA2B;KAC3B,aAAa;KACb,oBAAoB;KACpB,sBAAsB;KACvB;IACF;GACD,gBAAgB,CACd,GACA;IACE,sBAAsB;IACtB,YAAY;IACZ,uBAAuB;IACvB,kBAAkB;IAClB,uBAAuB;KAAC;KAAQ;KAAO;KAAY;KAAS;IAC7D,CACF;GAED,GAAG;GACJ;EACF;CAED;EACE,OAAO,CAAC,WAAW;EACnB,iBAAiB,EACf,YAAY,YACb;EACD,MAAM,GAAGA,KAAiB;EAC1B,OAAO,EACL,yCAAyC,CACvC,GACA;GACE,OAAO,EAAE;GACT,eAAe;GAChB,CACF,EACF;EACF;CAEDC;CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjKD,MAAa,sBACX,sBAAuD,EAAE,KAEzC,gDAAa,GAAG,kBAAkB,GAAG,oBAAoB"}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import js from "@eslint/js";
|
|
2
2
|
import prettierConfig from "eslint-config-prettier/flat";
|
|
3
|
-
import { Config, ConfigArray, ConfigWithExtends, FlatConfig, InfiniteDepthConfigWithExtends, config, configs, parser, plugin } from "typescript-eslint";
|
|
4
3
|
import { Linter } from "eslint";
|
|
5
|
-
import { defineConfig } from "eslint/config";
|
|
4
|
+
import { Config, defineConfig } from "eslint/config";
|
|
5
|
+
import { Config as TSESlintConfig, ConfigArray, ConfigWithExtends, FlatConfig, InfiniteDepthConfigWithExtends, config, configs, parser, plugin } from "typescript-eslint";
|
|
6
6
|
|
|
7
7
|
//#region src/disabledRules.d.ts
|
|
8
8
|
/**
|
|
@@ -2682,7 +2682,7 @@ declare const flatESLintConfig: [{
|
|
|
2682
2682
|
* @since 0.0.3
|
|
2683
2683
|
* @public
|
|
2684
2684
|
*/
|
|
2685
|
-
declare const createESLintConfig: (additionalOverrides?: Parameters<typeof defineConfig>) =>
|
|
2685
|
+
declare const createESLintConfig: (additionalOverrides?: Parameters<typeof defineConfig>) => Config[];
|
|
2686
2686
|
//#endregion
|
|
2687
|
-
export { type Config, type ConfigArray, type ConfigWithExtends, type FlatConfig, type InfiniteDepthConfigWithExtends, config, configs, createESLintConfig, disabledRules, flatESLintConfig, globalIgnores, globals, js, parser, plugin, prettierConfig, vitestGlobals };
|
|
2687
|
+
export { type Config, type ConfigArray, type ConfigWithExtends, type FlatConfig, type InfiniteDepthConfigWithExtends, type Linter, type TSESlintConfig, config, configs, createESLintConfig, defineConfig, disabledRules, flatESLintConfig, globalIgnores, globals, js, parser, plugin, prettierConfig, vitestGlobals };
|
|
2688
2688
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/disabledRules.ts","../src/globalIgnores.ts","../src/globals.ts","../src/shareableConfigs.ts","../src/utils.ts"],"mappings":";;;;;;;;;;;;;;cASa,aAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAb;cCEa,aAAA;EAAA,SAoBc,OAAA;EAAA,SAAA,IAAA;AAAA;;;;;;;;;;ADtB3B;cEEa,aAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;cA8BA,OAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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";
|
|
3
|
-
import { Config,
|
|
4
|
-
import {
|
|
3
|
+
import { Config, defineConfig } from "eslint/config";
|
|
4
|
+
import { Config as TSESlintConfig, ConfigArray, ConfigWithExtends, FlatConfig, InfiniteDepthConfigWithExtends, config, configs, parser, plugin } from "typescript-eslint";
|
|
5
5
|
import { Linter } from "eslint";
|
|
6
6
|
|
|
7
7
|
//#region src/disabledRules.d.ts
|
|
@@ -2682,7 +2682,7 @@ declare const flatESLintConfig: [{
|
|
|
2682
2682
|
* @since 0.0.3
|
|
2683
2683
|
* @public
|
|
2684
2684
|
*/
|
|
2685
|
-
declare const createESLintConfig: (additionalOverrides?: Parameters<typeof defineConfig>) =>
|
|
2685
|
+
declare const createESLintConfig: (additionalOverrides?: Parameters<typeof defineConfig>) => Config[];
|
|
2686
2686
|
//#endregion
|
|
2687
|
-
export { type Config, type ConfigArray, type ConfigWithExtends, type FlatConfig, type InfiniteDepthConfigWithExtends, config, configs, createESLintConfig, disabledRules, flatESLintConfig, globalIgnores, globals, js, parser, plugin, prettierConfig, vitestGlobals };
|
|
2687
|
+
export { type Config, type ConfigArray, type ConfigWithExtends, type FlatConfig, type InfiniteDepthConfigWithExtends, type Linter, type TSESlintConfig, config, configs, createESLintConfig, defineConfig, disabledRules, flatESLintConfig, globalIgnores, globals, js, parser, plugin, prettierConfig, vitestGlobals };
|
|
2688
2688
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/disabledRules.ts","../src/globalIgnores.ts","../src/globals.ts","../src/shareableConfigs.ts","../src/utils.ts"],"mappings":";;;;;;;;;;;;;;cASa,aAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAb;cCEa,aAAA;EAAA,SAoBc,OAAA;EAAA,SAAA,IAAA;AAAA;;;;;;;;;;ADtB3B;cEEa,aAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;ACEA;;;;;;;;ACAA;;;;;;;;;;;;;;;;;;;;;;;AA8BA;;;;;;;;;;;;;;;;;;;cE+Ca,kBAAA,GACX,mBAAA,GAAqB,UAAA,QAAkB,YAAA,MACtC,MAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import js from "@eslint/js";
|
|
2
2
|
import prettierConfig from "eslint-config-prettier/flat";
|
|
3
3
|
import globalIdentifiers from "globals";
|
|
4
|
-
import { config, configs, parser, plugin } from "typescript-eslint";
|
|
5
4
|
import { defineConfig } from "eslint/config";
|
|
5
|
+
import { config, configs, parser, plugin } from "typescript-eslint";
|
|
6
6
|
|
|
7
7
|
//#region src/disabledRules.ts
|
|
8
8
|
/**
|
|
@@ -44,18 +44,6 @@ const { browser, node, nodeBuiltin, vitest } = globalIdentifiers;
|
|
|
44
44
|
//#region package.json
|
|
45
45
|
var name = "@aryaemami59/eslint-config";
|
|
46
46
|
|
|
47
|
-
//#endregion
|
|
48
|
-
//#region src/packageJsonName.ts
|
|
49
|
-
/**
|
|
50
|
-
* This is used because if we import the package name from the
|
|
51
|
-
* `package.json` file, it will be bundled into the final output,
|
|
52
|
-
* which is not desired.
|
|
53
|
-
*
|
|
54
|
-
* @since 0.0.5
|
|
55
|
-
* @internal
|
|
56
|
-
*/
|
|
57
|
-
const packageJsonName = name;
|
|
58
|
-
|
|
59
47
|
//#endregion
|
|
60
48
|
//#region src/globalIgnores.ts
|
|
61
49
|
/**
|
|
@@ -85,7 +73,7 @@ const globalIgnores = {
|
|
|
85
73
|
"**/dist/",
|
|
86
74
|
"**/temp/"
|
|
87
75
|
],
|
|
88
|
-
name: `${
|
|
76
|
+
name: `${name}/global-ignores`
|
|
89
77
|
};
|
|
90
78
|
|
|
91
79
|
//#endregion
|
|
@@ -195,7 +183,7 @@ const flatESLintConfig = [
|
|
|
195
183
|
reportUnusedDisableDirectives: 2,
|
|
196
184
|
reportUnusedInlineConfigs: 2
|
|
197
185
|
},
|
|
198
|
-
name: `${
|
|
186
|
+
name: `${name}/defaults/overrides`,
|
|
199
187
|
rules: {
|
|
200
188
|
"object-shorthand": [
|
|
201
189
|
2,
|
|
@@ -225,7 +213,7 @@ const flatESLintConfig = [
|
|
|
225
213
|
{
|
|
226
214
|
files: ["**/*.cjs"],
|
|
227
215
|
languageOptions: { sourceType: "commonjs" },
|
|
228
|
-
name: `${
|
|
216
|
+
name: `${name}/commonjs-files`,
|
|
229
217
|
rules: { "@typescript-eslint/no-require-imports": [0, {
|
|
230
218
|
allow: [],
|
|
231
219
|
allowAsImport: false
|
|
@@ -323,5 +311,5 @@ const flatESLintConfig = [
|
|
|
323
311
|
const createESLintConfig = (additionalOverrides = []) => /* @__PURE__ */ defineConfig(...flatESLintConfig, ...additionalOverrides);
|
|
324
312
|
|
|
325
313
|
//#endregion
|
|
326
|
-
export { config, configs, createESLintConfig, disabledRules, flatESLintConfig, globalIgnores, globals, js, parser, plugin, prettierConfig, vitestGlobals };
|
|
314
|
+
export { config, configs, createESLintConfig, defineConfig, disabledRules, flatESLintConfig, globalIgnores, globals, js, parser, plugin, prettierConfig, vitestGlobals };
|
|
327
315
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["packageJson.name"],"sources":["../src/disabledRules.ts","../src/external.ts","../package.json","../src/packageJsonName.ts","../src/globalIgnores.ts","../src/globals.ts","../src/shareableConfigs.ts","../src/utils.ts"],"sourcesContent":["import type { Linter } from 'eslint'\n\n/**\n * An object comprised of ESLint rules to disable.\n * These rules are disabled in {@linkcode flatESLintConfig}.\n *\n * @since 0.0.3\n * @public\n */\nexport const disabledRules = {\n '@typescript-eslint/ban-ts-comment': [\n 0,\n {\n minimumDescriptionLength: 3,\n 'ts-check': false,\n 'ts-expect-error': 'allow-with-description',\n 'ts-ignore': true,\n 'ts-nocheck': true,\n },\n ],\n\n // TODO: Remove this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.\n '@typescript-eslint/consistent-generic-constructors': [0],\n\n '@typescript-eslint/no-unused-vars': [\n 0,\n {\n args: 'after-used',\n // Not included in default options\n argsIgnorePattern: '^_',\n caughtErrors: 'all',\n // Not included in default options\n caughtErrorsIgnorePattern: '^_',\n // Not included in default options\n destructuredArrayIgnorePattern: '^_',\n ignoreClassWithStaticInitBlock: false,\n ignoreRestSiblings: false,\n reportUsedIgnorePattern: false,\n vars: 'all',\n // Not included in default options\n varsIgnorePattern: '^_',\n },\n ],\n 'no-undef': [\n 0,\n {\n typeof: false,\n },\n ],\n} as const satisfies Linter.RulesRecord satisfies Record<\n keyof Linter.RulesRecord,\n [\n ruleSeverity: Extract<Linter.Severity, 0>,\n ...ruleOptions: readonly unknown[],\n ]\n>\n","import js from '@eslint/js'\nimport prettierConfig from 'eslint-config-prettier/flat'\nimport globalIdentifiers from 'globals'\nexport { config, configs, parser, plugin } from 'typescript-eslint'\nexport type {\n Config,\n ConfigArray,\n ConfigWithExtends,\n FlatConfig,\n InfiniteDepthConfigWithExtends,\n} from 'typescript-eslint'\nexport { js, prettierConfig }\nexport const { browser, node, nodeBuiltin, vitest } = globalIdentifiers\n","","import packageJson from '../package.json' with { type: 'json' }\n\n/**\n * This is used because if we import the package name from the\n * `package.json` file, it will be bundled into the final output,\n * which is not desired.\n *\n * @since 0.0.5\n * @internal\n */\nexport const packageJsonName = packageJson.name\n","import type { Config } from 'eslint/config'\nimport { packageJsonName } from './packageJsonName.js'\n\n/**\n * An object representing\n * {@link https://eslint.org/docs/latest/use/configure/ignore#ignoring-files | **global ignore patterns**}\n * for ESLint configuration.\n *\n * @since 0.0.3\n * @public\n */\nexport const globalIgnores = {\n ignores: [\n '**/__snapshots__/',\n '**/.docusaurus/',\n '**/.expo/',\n '**/.next/',\n '**/.playwright/',\n '**/.temp/',\n '**/.tmp/',\n '**/.turbo/',\n '**/.wrangler/',\n '**/.yalc/',\n '**/.yarn/',\n '**/*.snap',\n '**/build/',\n '**/coverage/',\n '**/dist/',\n '**/temp/',\n ],\n name: `${packageJsonName}/global-ignores`,\n} as const satisfies Config\n","import type { Linter } from 'eslint'\nimport { browser, node, nodeBuiltin, vitest } from './external.js'\n\n/**\n * An object representing the\n * {@link https://vitest.dev/config/#globals | globals} provided by\n * {@link https://vitest.dev | **Vitest**} for use in testing.\n *\n * @since 0.0.3\n * @public\n */\nexport const vitestGlobals = {\n afterAll: 'writable',\n afterEach: 'writable',\n assert: 'writable',\n assertType: 'writable',\n beforeAll: 'writable',\n beforeEach: 'writable',\n chai: 'writable',\n describe: 'writable',\n expect: 'writable',\n expectTypeOf: 'writable',\n it: 'writable',\n onTestFailed: 'writable',\n onTestFinished: 'writable',\n suite: 'writable',\n test: 'writable',\n vi: 'writable',\n vitest: 'writable',\n} as const satisfies Linter.Globals satisfies Record<\n keyof typeof vitest,\n Extract<Linter.GlobalConf, 'writable'>\n>\n\n/**\n * An object that specifies which global\n * variables are available during linting.\n *\n * @since 0.0.3\n * @public\n */\nexport const globals =\n /* @__PURE__ */\n Object.assign(\n {\n ...browser,\n ...node,\n ...nodeBuiltin,\n } as const satisfies Linter.Globals,\n\n {\n ...vitest,\n ...vitestGlobals,\n } as const satisfies Linter.Globals,\n ) satisfies Linter.Globals\n","import type { Linter } from 'eslint'\nimport { disabledRules } from './disabledRules.js'\nimport type { FlatConfig } from './external.js'\nimport { js, prettierConfig } from './external.js'\nimport { globalIgnores } from './globalIgnores.js'\nimport { globals } from './globals.js'\nimport { packageJsonName } from './packageJsonName.js'\n\n/**\n * Flat ESLint configuration tailored for projects using TypeScript.\n *\n * @example\n * <caption>#### __ECMAScript Modules (ESM) usage inside a file like `eslint.config.mts` or `eslint.config.mjs`__</caption>\n *\n * ```ts\n * import { flatESLintConfig } from '@aryaemami59/eslint-config'\n *\n * export default flatESLintConfig\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using `require`)__</caption>\n *\n * ```ts\n * const { flatESLintConfig } = require('@aryaemami59/eslint-config')\n *\n * module.exports = flatESLintConfig\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cjs` or `eslint.config.cts` (using dynamic import)__</caption>\n *\n * ```ts\n * module.exports = (async () =>\n * (await import('@aryaemami59/eslint-config')).flatESLintConfig)()\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` (using import and export assignment)__</caption>\n *\n * ```ts\n * import eslintConfigModule = require('@aryaemami59/eslint-config')\n * import flatESLintConfig = eslintConfigModule.flatESLintConfig\n *\n * export = flatESLintConfig\n * ```\n *\n * @since 0.0.3\n * @public\n */\nexport const flatESLintConfig = [\n // `ignores` must be first.\n // config with just `ignores` is the replacement for `.eslintignore`\n globalIgnores,\n\n {\n name: `${js.meta.name}/recommended`,\n ...js.configs.recommended,\n } as const satisfies FlatConfig.Config satisfies Linter.Config,\n\n // TODO: You can remove the type assertion in the next major version of `typescript-eslint`.\n // TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.\n // ...(configs.recommended satisfies Linter.Config[] as Linter.Config<any>[]),\n // TODO: You can remove the type assertion in the next major version of `typescript-eslint`.\n // TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.\n // ...(configs.stylistic satisfies Linter.Config[] as Linter.Config<any>[]),\n\n {\n languageOptions: {\n globals,\n parserOptions: {\n ecmaVersion: 'latest',\n projectService: true,\n } as const satisfies FlatConfig.ParserOptions satisfies Linter.ParserOptions,\n },\n linterOptions: {\n reportUnusedDisableDirectives: 2,\n reportUnusedInlineConfigs: 2,\n },\n name: `${packageJsonName}/defaults/overrides`,\n\n rules: {\n // TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.\n // '@typescript-eslint/consistent-type-definitions': [2, 'type'],\n // '@typescript-eslint/consistent-type-exports': [\n // 2,\n // { fixMixedExportsWithInlineTypeSpecifier: false },\n // ],\n // '@typescript-eslint/consistent-type-imports': [\n // 2,\n // {\n // disallowTypeAnnotations: true,\n // fixStyle: 'separate-type-imports',\n // prefer: 'type-imports',\n // },\n // ],\n // '@typescript-eslint/no-confusing-void-expression': [\n // 2,\n // {\n // ignoreArrowShorthand: false,\n // ignoreVoidOperator: false,\n // ignoreVoidReturningFunctions: false,\n // },\n // ],\n // '@typescript-eslint/no-duplicate-type-constituents': [\n // 2,\n // {\n // ignoreIntersections: false,\n // ignoreUnions: false,\n // },\n // ],\n // '@typescript-eslint/no-empty-object-type': [\n // 2,\n // {\n // allowInterfaces: 'never',\n // allowObjectTypes: 'never',\n // },\n // ],\n // '@typescript-eslint/no-explicit-any': [\n // 2,\n // {\n // fixToUnknown: false,\n // ignoreRestArgs: false,\n // },\n // ],\n // '@typescript-eslint/no-inferrable-types': [\n // 2,\n // {\n // ignoreParameters: false,\n // ignoreProperties: false,\n // },\n // ],\n // '@typescript-eslint/no-invalid-void-type': [\n // 2,\n // {\n // allowAsThisParameter: false,\n // allowInGenericTypeArguments: true,\n // },\n // ],\n // '@typescript-eslint/no-namespace': [\n // 2,\n // {\n // allowDeclarations: false,\n // allowDefinitionFiles: true,\n // },\n // ],\n // '@typescript-eslint/no-redundant-type-constituents': [2],\n // '@typescript-eslint/no-require-imports': [\n // 2,\n // {\n // allow: [],\n // allowAsImport: true,\n // },\n // ],\n // '@typescript-eslint/no-restricted-types': [\n // 2,\n // {\n // types: {\n // '{}': {\n // message: `\n // - If you want to represent an empty object, use \\`type EmptyObject = Record<string, never>\\`.\n // - If you want to represent an object literal, use either \\`type AnyObject = Record<string, any>\\` or \\`object\\`.\n // - If you want to represent any non-nullish value, use \\`type AnyNonNullishValue = NonNullable<unknown>\\`.`,\n // suggest: [\n // 'AnyNonNullishValue',\n // 'EmptyObject',\n // 'AnyObject',\n // 'object',\n // 'Record<string, never>',\n // 'Record<string, any>',\n // 'NonNullable<unknown>',\n // ],\n // },\n // },\n // },\n // ],\n // '@typescript-eslint/no-unnecessary-type-arguments': [2],\n // '@typescript-eslint/no-unnecessary-type-assertion': [\n // 2,\n // { typesToIgnore: [] },\n // ],\n // '@typescript-eslint/no-unnecessary-type-parameters': [2],\n // '@typescript-eslint/prefer-nullish-coalescing': [\n // 2,\n // {\n // allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,\n // ignoreBooleanCoercion: false,\n // ignoreConditionalTests: true,\n // ignoreIfStatements: false,\n // ignoreMixedLogicalExpressions: false,\n // ignorePrimitives: {\n // bigint: false,\n // boolean: false,\n // number: false,\n // string: false,\n // },\n // ignoreTernaryTests: false,\n // },\n // ],\n // '@typescript-eslint/require-await': [2],\n // '@typescript-eslint/unified-signatures': [\n // 2,\n // {\n // ignoreDifferentlyNamedParameters: false,\n // ignoreOverloadsWithDifferentJSDoc: false,\n // },\n // ],\n 'object-shorthand': [\n 2,\n 'always',\n {\n avoidExplicitReturnArrows: true,\n avoidQuotes: true,\n ignoreConstructors: true,\n methodsIgnorePattern: '',\n },\n ],\n 'sort-imports': [\n 2,\n {\n allowSeparatedGroups: true,\n ignoreCase: false,\n ignoreDeclarationSort: true,\n ignoreMemberSort: false,\n memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],\n },\n ],\n\n ...disabledRules,\n },\n } as const satisfies Linter.Config,\n\n {\n files: ['**/*.cjs'],\n languageOptions: {\n sourceType: 'commonjs',\n } as const satisfies FlatConfig.LanguageOptions satisfies Linter.LanguageOptions,\n name: `${packageJsonName}/commonjs-files`,\n rules: {\n '@typescript-eslint/no-require-imports': [\n 0,\n {\n allow: [],\n allowAsImport: false,\n },\n ],\n },\n } as const satisfies Linter.Config,\n\n prettierConfig,\n] as const satisfies Linter.Config[]\n","import type { Linter } from 'eslint'\nimport { defineConfig } from 'eslint/config'\nimport { flatESLintConfig } from './shareableConfigs.js'\n\n/**\n * A function that returns {@linkcode flatESLintConfig}\n * along with optional additional overrides.\n * It's made mainly to provide intellisense and eliminate\n * the need for manual type annotations using JSDoc comments.\n *\n * @param [additionalOverrides=[]] - **Optional** additional overrides to apply to the configuration.\n * @returns An augmented version of the default {@linkcode flatESLintConfig}, incorporating any provided overrides.\n *\n * @example\n * <caption>#### __ECMAScript Modules (ESM) usage inside a file like `eslint.config.mts` or `eslint.config.mjs`__</caption>\n *\n * ```ts\n * import { createESLintConfig } from '@aryaemami59/eslint-config'\n *\n * export default createESLintConfig([\n * {\n * rules: {\n * 'no-console': [0],\n * },\n * },\n * {\n * // ...Other additional overrides\n * },\n * ])\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using `require`)__</caption>\n *\n * ```ts\n * const { createESLintConfig } = require('@aryaemami59/eslint-config')\n *\n * module.exports = createESLintConfig([\n * {\n * rules: {\n * 'no-console': [0],\n * },\n * },\n * {\n * // ...Other additional overrides\n * },\n * ])\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using dynamic import)__</caption>\n *\n * ```ts\n * module.exports = (async () =>\n * (await import('@aryaemami59/eslint-config')).createESLintConfig([\n * {\n * rules: {\n * 'no-console': [0],\n * },\n * },\n * {\n * // ...Other additional overrides\n * },\n * ]))()\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` (using import and export assignment)__</caption>\n *\n * ```ts\n * import eslintConfigModule = require('@aryaemami59/eslint-config')\n * import createESLintConfig = eslintConfigModule.createESLintConfig\n *\n * export = createESLintConfig([\n * {\n * rules: {\n * 'no-console': [0],\n * },\n * },\n * {\n * // ...Other additional overrides\n * },\n * ])\n * ```\n *\n * @since 0.0.3\n * @public\n */\nexport const createESLintConfig = (\n additionalOverrides: Parameters<typeof defineConfig> = [],\n): Linter.Config[] =>\n /* @__PURE__ */ defineConfig(...flatESLintConfig, ...additionalOverrides)\n"],"mappings":";;;;;;;;;;;;;;AASA,MAAa,gBAAgB;CAC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gBAAgB;EAEzB,OAAO;GA8HL,oBAAoB;IAClB;IACA;IACA;KACE,2BAA2B;KAC3B,aAAa;KACb,oBAAoB;KACpB,sBAAsB;KACvB;IACF;GACD,gBAAgB,CACd,GACA;IACE,sBAAsB;IACtB,YAAY;IACZ,uBAAuB;IACvB,kBAAkB;IAClB,uBAAuB;KAAC;KAAQ;KAAO;KAAY;KAAS;IAC7D,CACF;GAED,GAAG;GACJ;EACF;CAED;EACE,OAAO,CAAC,WAAW;EACnB,iBAAiB,EACf,YAAY,YACb;EACD,MAAM,GAAG,gBAAgB;EACzB,OAAO,EACL,yCAAyC,CACvC,GACA;GACE,OAAO,EAAE;GACT,eAAe;GAChB,CACF,EACF;EACF;CAED;CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClKD,MAAa,sBACX,sBAAuD,EAAE,KAEzC,6BAAa,GAAG,kBAAkB,GAAG,oBAAoB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["packageJson.name","packageJson.name"],"sources":["../src/disabledRules.ts","../src/external.ts","../package.json","../src/globalIgnores.ts","../src/globals.ts","../src/shareableConfigs.ts","../src/utils.ts"],"sourcesContent":["import type { Linter } from './external.js'\n\n/**\n * An object comprised of ESLint rules to disable.\n * These rules are disabled in {@linkcode flatESLintConfig}.\n *\n * @since 0.0.3\n * @public\n */\nexport const disabledRules = {\n '@typescript-eslint/ban-ts-comment': [\n 0,\n {\n minimumDescriptionLength: 3,\n 'ts-check': false,\n 'ts-expect-error': 'allow-with-description',\n 'ts-ignore': true,\n 'ts-nocheck': true,\n },\n ],\n\n // TODO: Remove this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.\n '@typescript-eslint/consistent-generic-constructors': [0],\n\n '@typescript-eslint/no-unused-vars': [\n 0,\n {\n args: 'after-used',\n // Not included in default options\n argsIgnorePattern: '^_',\n caughtErrors: 'all',\n // Not included in default options\n caughtErrorsIgnorePattern: '^_',\n // Not included in default options\n destructuredArrayIgnorePattern: '^_',\n ignoreClassWithStaticInitBlock: false,\n ignoreRestSiblings: false,\n reportUsedIgnorePattern: false,\n vars: 'all',\n // Not included in default options\n varsIgnorePattern: '^_',\n },\n ],\n 'no-undef': [\n 0,\n {\n typeof: false,\n },\n ],\n} as const satisfies Linter.RulesRecord satisfies Record<\n keyof Linter.RulesRecord,\n [\n ruleSeverity: Extract<Linter.Severity, 0>,\n ...ruleOptions: readonly unknown[],\n ]\n>\n","import js from '@eslint/js'\nimport prettierConfig from 'eslint-config-prettier/flat'\nimport globalIdentifiers from 'globals'\nexport type { Linter } from 'eslint'\nexport { defineConfig } from 'eslint/config'\nexport type { Config } from 'eslint/config'\nexport { config, configs, parser, plugin } from 'typescript-eslint'\nexport type {\n ConfigArray,\n ConfigWithExtends,\n FlatConfig,\n InfiniteDepthConfigWithExtends,\n Config as TSESlintConfig,\n} from 'typescript-eslint'\nexport { js, prettierConfig }\nexport const { browser, node, nodeBuiltin, vitest } = globalIdentifiers\n","","import packageJson from '../package.json' with { type: 'json' }\nimport type { Config } from './external.js'\n\n/**\n * An object representing\n * {@link https://eslint.org/docs/latest/use/configure/ignore#ignoring-files | **global ignore patterns**}\n * for ESLint configuration.\n *\n * @since 0.0.3\n * @public\n */\nexport const globalIgnores = {\n ignores: [\n '**/__snapshots__/',\n '**/.docusaurus/',\n '**/.expo/',\n '**/.next/',\n '**/.playwright/',\n '**/.temp/',\n '**/.tmp/',\n '**/.turbo/',\n '**/.wrangler/',\n '**/.yalc/',\n '**/.yarn/',\n '**/*.snap',\n '**/build/',\n '**/coverage/',\n '**/dist/',\n '**/temp/',\n ],\n name: `${packageJson.name}/global-ignores`,\n} as const satisfies Config\n","import type { Linter } from './external.js'\nimport { browser, node, nodeBuiltin, vitest } from './external.js'\n\n/**\n * An object representing the\n * {@link https://vitest.dev/config/#globals | globals} provided by\n * {@link https://vitest.dev | **Vitest**} for use in testing.\n *\n * @since 0.0.3\n * @public\n */\nexport const vitestGlobals = {\n afterAll: 'writable',\n afterEach: 'writable',\n assert: 'writable',\n assertType: 'writable',\n beforeAll: 'writable',\n beforeEach: 'writable',\n chai: 'writable',\n describe: 'writable',\n expect: 'writable',\n expectTypeOf: 'writable',\n it: 'writable',\n onTestFailed: 'writable',\n onTestFinished: 'writable',\n suite: 'writable',\n test: 'writable',\n vi: 'writable',\n vitest: 'writable',\n} as const satisfies Linter.Globals satisfies Record<\n keyof typeof vitest,\n Extract<Linter.GlobalConf, 'writable'>\n>\n\n/**\n * An object that specifies which global\n * variables are available during linting.\n *\n * @since 0.0.3\n * @public\n */\nexport const globals =\n /* @__PURE__ */\n Object.assign(\n {\n ...browser,\n ...node,\n ...nodeBuiltin,\n } as const satisfies Linter.Globals,\n\n {\n ...vitest,\n ...vitestGlobals,\n } as const satisfies Linter.Globals,\n ) satisfies Linter.Globals\n","import packageJson from '../package.json' with { type: 'json' }\nimport { disabledRules } from './disabledRules.js'\nimport type { Config, FlatConfig, Linter } from './external.js'\nimport { js, prettierConfig } from './external.js'\nimport { globalIgnores } from './globalIgnores.js'\nimport { globals } from './globals.js'\n\n/**\n * Flat ESLint configuration tailored for projects using TypeScript.\n *\n * @example\n * <caption>#### __ECMAScript Modules (ESM) usage inside a file like `eslint.config.mts` or `eslint.config.mjs`__</caption>\n *\n * ```ts\n * import { flatESLintConfig } from '@aryaemami59/eslint-config'\n *\n * export default flatESLintConfig\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using `require`)__</caption>\n *\n * ```ts\n * const { flatESLintConfig } = require('@aryaemami59/eslint-config')\n *\n * module.exports = flatESLintConfig\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cjs` or `eslint.config.cts` (using dynamic import)__</caption>\n *\n * ```ts\n * module.exports = (async () =>\n * (await import('@aryaemami59/eslint-config')).flatESLintConfig)()\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` (using import and export assignment)__</caption>\n *\n * ```ts\n * import eslintConfigModule = require('@aryaemami59/eslint-config')\n * import flatESLintConfig = eslintConfigModule.flatESLintConfig\n *\n * export = flatESLintConfig\n * ```\n *\n * @since 0.0.3\n * @public\n */\nexport const flatESLintConfig = [\n // `ignores` must be first.\n // config with just `ignores` is the replacement for `.eslintignore`\n globalIgnores,\n\n {\n name: `${js.meta.name}/recommended`,\n ...js.configs.recommended,\n } as const satisfies FlatConfig.Config satisfies Config,\n\n // TODO: You can remove the type assertion in the next major version of `typescript-eslint`.\n // TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.\n // ...(configs.recommended satisfies Config[] as Config<any>[]),\n // TODO: You can remove the type assertion in the next major version of `typescript-eslint`.\n // TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.\n // ...(configs.stylistic satisfies Config[] as Config<any>[]),\n\n {\n languageOptions: {\n globals,\n parserOptions: {\n ecmaVersion: 'latest',\n projectService: true,\n } as const satisfies FlatConfig.ParserOptions satisfies Linter.ParserOptions,\n },\n linterOptions: {\n reportUnusedDisableDirectives: 2,\n reportUnusedInlineConfigs: 2,\n },\n name: `${packageJson.name}/defaults/overrides`,\n\n rules: {\n // TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.\n // '@typescript-eslint/consistent-type-definitions': [2, 'type'],\n // '@typescript-eslint/consistent-type-exports': [\n // 2,\n // { fixMixedExportsWithInlineTypeSpecifier: false },\n // ],\n // '@typescript-eslint/consistent-type-imports': [\n // 2,\n // {\n // disallowTypeAnnotations: true,\n // fixStyle: 'separate-type-imports',\n // prefer: 'type-imports',\n // },\n // ],\n // '@typescript-eslint/no-confusing-void-expression': [\n // 2,\n // {\n // ignoreArrowShorthand: false,\n // ignoreVoidOperator: false,\n // ignoreVoidReturningFunctions: false,\n // },\n // ],\n // '@typescript-eslint/no-duplicate-type-constituents': [\n // 2,\n // {\n // ignoreIntersections: false,\n // ignoreUnions: false,\n // },\n // ],\n // '@typescript-eslint/no-empty-object-type': [\n // 2,\n // {\n // allowInterfaces: 'never',\n // allowObjectTypes: 'never',\n // },\n // ],\n // '@typescript-eslint/no-explicit-any': [\n // 2,\n // {\n // fixToUnknown: false,\n // ignoreRestArgs: false,\n // },\n // ],\n // '@typescript-eslint/no-inferrable-types': [\n // 2,\n // {\n // ignoreParameters: false,\n // ignoreProperties: false,\n // },\n // ],\n // '@typescript-eslint/no-invalid-void-type': [\n // 2,\n // {\n // allowAsThisParameter: false,\n // allowInGenericTypeArguments: true,\n // },\n // ],\n // '@typescript-eslint/no-namespace': [\n // 2,\n // {\n // allowDeclarations: false,\n // allowDefinitionFiles: true,\n // },\n // ],\n // '@typescript-eslint/no-redundant-type-constituents': [2],\n // '@typescript-eslint/no-require-imports': [\n // 2,\n // {\n // allow: [],\n // allowAsImport: true,\n // },\n // ],\n // '@typescript-eslint/no-restricted-types': [\n // 2,\n // {\n // types: {\n // '{}': {\n // message: `\n // - If you want to represent an empty object, use \\`type EmptyObject = Record<string, never>\\`.\n // - If you want to represent an object literal, use either \\`type AnyObject = Record<string, any>\\` or \\`object\\`.\n // - If you want to represent any non-nullish value, use \\`type AnyNonNullishValue = NonNullable<unknown>\\`.`,\n // suggest: [\n // 'AnyNonNullishValue',\n // 'EmptyObject',\n // 'AnyObject',\n // 'object',\n // 'Record<string, never>',\n // 'Record<string, any>',\n // 'NonNullable<unknown>',\n // ],\n // },\n // },\n // },\n // ],\n // '@typescript-eslint/no-unnecessary-type-arguments': [2],\n // '@typescript-eslint/no-unnecessary-type-assertion': [\n // 2,\n // { typesToIgnore: [] },\n // ],\n // '@typescript-eslint/no-unnecessary-type-parameters': [2],\n // '@typescript-eslint/prefer-nullish-coalescing': [\n // 2,\n // {\n // allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,\n // ignoreBooleanCoercion: false,\n // ignoreConditionalTests: true,\n // ignoreIfStatements: false,\n // ignoreMixedLogicalExpressions: false,\n // ignorePrimitives: {\n // bigint: false,\n // boolean: false,\n // number: false,\n // string: false,\n // },\n // ignoreTernaryTests: false,\n // },\n // ],\n // '@typescript-eslint/require-await': [2],\n // '@typescript-eslint/unified-signatures': [\n // 2,\n // {\n // ignoreDifferentlyNamedParameters: false,\n // ignoreOverloadsWithDifferentJSDoc: false,\n // },\n // ],\n 'object-shorthand': [\n 2,\n 'always',\n {\n avoidExplicitReturnArrows: true,\n avoidQuotes: true,\n ignoreConstructors: true,\n methodsIgnorePattern: '',\n },\n ],\n 'sort-imports': [\n 2,\n {\n allowSeparatedGroups: true,\n ignoreCase: false,\n ignoreDeclarationSort: true,\n ignoreMemberSort: false,\n memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],\n },\n ],\n\n ...disabledRules,\n },\n } as const satisfies Config,\n\n {\n files: ['**/*.cjs'],\n languageOptions: {\n sourceType: 'commonjs',\n } as const satisfies FlatConfig.LanguageOptions satisfies Linter.LanguageOptions,\n name: `${packageJson.name}/commonjs-files`,\n rules: {\n '@typescript-eslint/no-require-imports': [\n 0,\n {\n allow: [],\n allowAsImport: false,\n },\n ],\n },\n } as const satisfies Config,\n\n prettierConfig,\n] as const satisfies Config[]\n","import type { Config } from './external.js'\nimport { defineConfig } from './external.js'\nimport { flatESLintConfig } from './shareableConfigs.js'\n\n/**\n * A function that returns {@linkcode flatESLintConfig}\n * along with optional additional overrides.\n * It's made mainly to provide intellisense and eliminate\n * the need for manual type annotations using JSDoc comments.\n *\n * @param [additionalOverrides=[]] - **Optional** additional overrides to apply to the configuration.\n * @returns An augmented version of the default {@linkcode flatESLintConfig}, incorporating any provided overrides.\n *\n * @example\n * <caption>#### __ECMAScript Modules (ESM) usage inside a file like `eslint.config.mts` or `eslint.config.mjs`__</caption>\n *\n * ```ts\n * import { createESLintConfig } from '@aryaemami59/eslint-config'\n *\n * export default createESLintConfig([\n * {\n * rules: {\n * 'no-console': [0],\n * },\n * },\n * {\n * // ...Other additional overrides\n * },\n * ])\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using `require`)__</caption>\n *\n * ```ts\n * const { createESLintConfig } = require('@aryaemami59/eslint-config')\n *\n * module.exports = createESLintConfig([\n * {\n * rules: {\n * 'no-console': [0],\n * },\n * },\n * {\n * // ...Other additional overrides\n * },\n * ])\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using dynamic import)__</caption>\n *\n * ```ts\n * module.exports = (async () =>\n * (await import('@aryaemami59/eslint-config')).createESLintConfig([\n * {\n * rules: {\n * 'no-console': [0],\n * },\n * },\n * {\n * // ...Other additional overrides\n * },\n * ]))()\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` (using import and export assignment)__</caption>\n *\n * ```ts\n * import eslintConfigModule = require('@aryaemami59/eslint-config')\n * import createESLintConfig = eslintConfigModule.createESLintConfig\n *\n * export = createESLintConfig([\n * {\n * rules: {\n * 'no-console': [0],\n * },\n * },\n * {\n * // ...Other additional overrides\n * },\n * ])\n * ```\n *\n * @since 0.0.3\n * @public\n */\nexport const createESLintConfig = (\n additionalOverrides: Parameters<typeof defineConfig> = [],\n): Config[] =>\n /* @__PURE__ */ defineConfig(...flatESLintConfig, ...additionalOverrides)\n"],"mappings":";;;;;;;;;;;;;;AASA,MAAa,gBAAgB;CAC3B,qCAAqC,CACnC,GACA;EACE,0BAA0B;EAC1B,YAAY;EACZ,mBAAmB;EACnB,aAAa;EACb,cAAc;EACf,CACF;CAGD,sDAAsD,CAAC,EAAE;CAEzD,qCAAqC,CACnC,GACA;EACE,MAAM;EAEN,mBAAmB;EACnB,cAAc;EAEd,2BAA2B;EAE3B,gCAAgC;EAChC,gCAAgC;EAChC,oBAAoB;EACpB,yBAAyB;EACzB,MAAM;EAEN,mBAAmB;EACpB,CACF;CACD,YA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,GAAGA,KAAiB;EAC1B,OAAO,EACL,yCAAyC,CACvC,GACA;GACE,OAAO,EAAE;GACT,eAAe;GAChB,CACF,EACF;EACF;CAED;CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjKD,MAAa,sBACX,sBAAuD,EAAE,KAEzC,6BAAa,GAAG,kBAAkB,GAAG,oBAAoB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aryaemami59/eslint-config",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "ESLint configuration for TypeScript projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -67,18 +67,18 @@
|
|
|
67
67
|
"typecheck": "tsc -p ${INIT_CWD}/tsconfig.json"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@eslint/js": "^
|
|
71
|
-
"@typescript-eslint/utils": "^8.
|
|
70
|
+
"@eslint/js": "^9.39.2",
|
|
71
|
+
"@typescript-eslint/utils": "^8.55.0",
|
|
72
72
|
"eslint-config-prettier": "^10.1.8",
|
|
73
73
|
"globals": "^17.3.0",
|
|
74
|
-
"typescript-eslint": "^8.
|
|
74
|
+
"typescript-eslint": "^8.55.0"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
78
78
|
"@aryaemami59/tsconfig": "workspace:^",
|
|
79
79
|
"@eslint/core": "^1.1.0",
|
|
80
|
-
"@types/node": "^25.2.
|
|
81
|
-
"eslint": "^
|
|
80
|
+
"@types/node": "^25.2.3",
|
|
81
|
+
"eslint": "^9.39.2",
|
|
82
82
|
"publint": "^0.3.17",
|
|
83
83
|
"rimraf": "^6.1.2",
|
|
84
84
|
"tsdown": "^0.20.3",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
88
|
"@eslint/core": "*",
|
|
89
|
-
"eslint": "
|
|
89
|
+
"eslint": "^9 || ^10",
|
|
90
90
|
"typescript": "*"
|
|
91
91
|
},
|
|
92
92
|
"peerDependenciesMeta": {
|
package/src/disabledRules.ts
CHANGED
package/src/external.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import js from '@eslint/js'
|
|
2
2
|
import prettierConfig from 'eslint-config-prettier/flat'
|
|
3
3
|
import globalIdentifiers from 'globals'
|
|
4
|
+
export type { Linter } from 'eslint'
|
|
5
|
+
export { defineConfig } from 'eslint/config'
|
|
6
|
+
export type { Config } from 'eslint/config'
|
|
4
7
|
export { config, configs, parser, plugin } from 'typescript-eslint'
|
|
5
8
|
export type {
|
|
6
|
-
Config,
|
|
7
9
|
ConfigArray,
|
|
8
10
|
ConfigWithExtends,
|
|
9
11
|
FlatConfig,
|
|
10
12
|
InfiniteDepthConfigWithExtends,
|
|
13
|
+
Config as TSESlintConfig,
|
|
11
14
|
} from 'typescript-eslint'
|
|
12
15
|
export { js, prettierConfig }
|
|
13
16
|
export const { browser, node, nodeBuiltin, vitest } = globalIdentifiers
|
package/src/globalIgnores.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import packageJson from '../package.json' with { type: 'json' }
|
|
2
|
+
import type { Config } from './external.js'
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* An object representing
|
|
@@ -28,5 +28,5 @@ export const globalIgnores = {
|
|
|
28
28
|
'**/dist/',
|
|
29
29
|
'**/temp/',
|
|
30
30
|
],
|
|
31
|
-
name: `${
|
|
31
|
+
name: `${packageJson.name}/global-ignores`,
|
|
32
32
|
} as const satisfies Config
|
package/src/globals.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { disabledRules } from './disabledRules.js'
|
|
|
2
2
|
export {
|
|
3
3
|
config,
|
|
4
4
|
configs,
|
|
5
|
+
defineConfig,
|
|
5
6
|
js,
|
|
6
7
|
parser,
|
|
7
8
|
plugin,
|
|
@@ -13,6 +14,8 @@ export type {
|
|
|
13
14
|
ConfigWithExtends,
|
|
14
15
|
FlatConfig,
|
|
15
16
|
InfiniteDepthConfigWithExtends,
|
|
17
|
+
Linter,
|
|
18
|
+
TSESlintConfig,
|
|
16
19
|
} from './external.js'
|
|
17
20
|
export { globalIgnores } from './globalIgnores.js'
|
|
18
21
|
export { globals, vitestGlobals } from './globals.js'
|
package/src/shareableConfigs.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import packageJson from '../package.json' with { type: 'json' }
|
|
2
2
|
import { disabledRules } from './disabledRules.js'
|
|
3
|
-
import type { FlatConfig } from './external.js'
|
|
3
|
+
import type { Config, FlatConfig, Linter } from './external.js'
|
|
4
4
|
import { js, prettierConfig } from './external.js'
|
|
5
5
|
import { globalIgnores } from './globalIgnores.js'
|
|
6
6
|
import { globals } from './globals.js'
|
|
7
|
-
import { packageJsonName } from './packageJsonName.js'
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Flat ESLint configuration tailored for projects using TypeScript.
|
|
@@ -56,14 +55,14 @@ export const flatESLintConfig = [
|
|
|
56
55
|
{
|
|
57
56
|
name: `${js.meta.name}/recommended`,
|
|
58
57
|
...js.configs.recommended,
|
|
59
|
-
} as const satisfies FlatConfig.Config satisfies
|
|
58
|
+
} as const satisfies FlatConfig.Config satisfies Config,
|
|
60
59
|
|
|
61
60
|
// TODO: You can remove the type assertion in the next major version of `typescript-eslint`.
|
|
62
61
|
// TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.
|
|
63
|
-
// ...(configs.recommended satisfies
|
|
62
|
+
// ...(configs.recommended satisfies Config[] as Config<any>[]),
|
|
64
63
|
// TODO: You can remove the type assertion in the next major version of `typescript-eslint`.
|
|
65
64
|
// TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.
|
|
66
|
-
// ...(configs.stylistic satisfies
|
|
65
|
+
// ...(configs.stylistic satisfies Config[] as Config<any>[]),
|
|
67
66
|
|
|
68
67
|
{
|
|
69
68
|
languageOptions: {
|
|
@@ -77,7 +76,7 @@ export const flatESLintConfig = [
|
|
|
77
76
|
reportUnusedDisableDirectives: 2,
|
|
78
77
|
reportUnusedInlineConfigs: 2,
|
|
79
78
|
},
|
|
80
|
-
name: `${
|
|
79
|
+
name: `${packageJson.name}/defaults/overrides`,
|
|
81
80
|
|
|
82
81
|
rules: {
|
|
83
82
|
// TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.
|
|
@@ -228,14 +227,14 @@ export const flatESLintConfig = [
|
|
|
228
227
|
|
|
229
228
|
...disabledRules,
|
|
230
229
|
},
|
|
231
|
-
} as const satisfies
|
|
230
|
+
} as const satisfies Config,
|
|
232
231
|
|
|
233
232
|
{
|
|
234
233
|
files: ['**/*.cjs'],
|
|
235
234
|
languageOptions: {
|
|
236
235
|
sourceType: 'commonjs',
|
|
237
236
|
} as const satisfies FlatConfig.LanguageOptions satisfies Linter.LanguageOptions,
|
|
238
|
-
name: `${
|
|
237
|
+
name: `${packageJson.name}/commonjs-files`,
|
|
239
238
|
rules: {
|
|
240
239
|
'@typescript-eslint/no-require-imports': [
|
|
241
240
|
0,
|
|
@@ -245,7 +244,7 @@ export const flatESLintConfig = [
|
|
|
245
244
|
},
|
|
246
245
|
],
|
|
247
246
|
},
|
|
248
|
-
} as const satisfies
|
|
247
|
+
} as const satisfies Config,
|
|
249
248
|
|
|
250
249
|
prettierConfig,
|
|
251
|
-
] as const satisfies
|
|
250
|
+
] as const satisfies Config[]
|
package/src/utils.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { defineConfig } from '
|
|
1
|
+
import type { Config } from './external.js'
|
|
2
|
+
import { defineConfig } from './external.js'
|
|
3
3
|
import { flatESLintConfig } from './shareableConfigs.js'
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -88,5 +88,5 @@ import { flatESLintConfig } from './shareableConfigs.js'
|
|
|
88
88
|
*/
|
|
89
89
|
export const createESLintConfig = (
|
|
90
90
|
additionalOverrides: Parameters<typeof defineConfig> = [],
|
|
91
|
-
):
|
|
91
|
+
): Config[] =>
|
|
92
92
|
/* @__PURE__ */ defineConfig(...flatESLintConfig, ...additionalOverrides)
|