@aryaemami59/eslint-config 0.0.5 → 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.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/disabledRules.ts","../src/external.ts","../src/packageName.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 'no-undef': [0, { typeof: false }],\n '@typescript-eslint/no-unused-vars': [\n 0,\n {\n args: 'all',\n argsIgnorePattern: '^_',\n caughtErrors: 'all',\n caughtErrorsIgnorePattern: '^_',\n destructuredArrayIgnorePattern: '^_',\n varsIgnorePattern: '^_',\n ignoreRestSiblings: true,\n },\n ],\n '@typescript-eslint/ban-ts-comment': [\n 0,\n {\n 'ts-expect-error': 'allow-with-description',\n 'ts-ignore': true,\n 'ts-nocheck': true,\n 'ts-check': false,\n minimumDescriptionLength: 3,\n },\n ],\n} as const satisfies Linter.RulesRecord satisfies Record<\n keyof Linter.RulesRecord,\n [Extract<Linter.Severity, 0>, ...(readonly unknown[])]\n>\n","import js from '@eslint/js'\nimport prettierConfig from 'eslint-config-prettier/flat'\nexport { config, configs, parser, plugin } from 'typescript-eslint'\nexport type {\n Config,\n ConfigArray,\n ConfigWithExtends,\n InfiniteDepthConfigWithExtends,\n} from 'typescript-eslint'\nexport { js, prettierConfig }\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 packageName = '@aryaemami59/eslint-config'\n","import type { TSESLint } from '@typescript-eslint/utils'\nimport type { Linter } from 'eslint'\nimport { packageName } from './packageName.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 name: `${packageName}/global-ignores`,\n ignores: [\n '**/dist/',\n '**/build/',\n '**/lib/',\n '**/coverage/',\n '**/__snapshots__/',\n '**/temp/',\n '**/.temp/',\n '**/.tmp/',\n '**/.yalc/',\n '**/.yarn/',\n '**/.docusaurus/',\n '**/.next/',\n '**/.expo/',\n '**/*.snap',\n ],\n} as const satisfies TSESLint.FlatConfig.Config satisfies Linter.Config\n","import type { Linter } from 'eslint'\nimport globalIdentifiers from 'globals'\n\nconst { browser, node, nodeBuiltin, vitest } = globalIdentifiers\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 suite: 'writable',\n test: 'writable',\n chai: 'writable',\n describe: 'writable',\n it: 'writable',\n expectTypeOf: 'writable',\n assertType: 'writable',\n expect: 'writable',\n assert: 'writable',\n vitest: 'writable',\n vi: 'writable',\n beforeAll: 'writable',\n afterAll: 'writable',\n beforeEach: 'writable',\n afterEach: 'writable',\n onTestFailed: 'writable',\n onTestFinished: '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 { TSESLint } from '@typescript-eslint/utils'\nimport type { Linter } from 'eslint'\nimport { disabledRules } from './disabledRules.js'\nimport { config, configs, js, prettierConfig } from './external.js'\nimport { globalIgnores } from './globalIgnores.js'\nimport { globals } from './globals.js'\nimport { packageName } from './packageName.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: TSESLint.FlatConfig.Config[] =\n /* @__PURE__ */ config(\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 TSESLint.FlatConfig.Config satisfies Linter.Config,\n\n configs.recommended,\n configs.stylistic,\n\n {\n name: `${packageName}/defaults/overrides`,\n languageOptions: {\n globals,\n parserOptions: {\n ecmaVersion: 'latest',\n projectService: true,\n },\n },\n rules: {\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/consistent-type-exports': [\n 2,\n { fixMixedExportsWithInlineTypeSpecifier: false },\n ],\n '@typescript-eslint/no-explicit-any': [\n 2,\n {\n fixToUnknown: false,\n ignoreRestArgs: 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-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-namespace': [\n 2,\n {\n allowDeclarations: false,\n allowDefinitionFiles: true,\n },\n ],\n '@typescript-eslint/consistent-type-definitions': [2, 'type'],\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 '@typescript-eslint/unified-signatures': [\n 2,\n {\n ignoreDifferentlyNamedParameters: false,\n ignoreOverloadsWithDifferentJSDoc: false,\n },\n ],\n '@typescript-eslint/no-unnecessary-type-parameters': [2],\n '@typescript-eslint/no-invalid-void-type': [\n 2,\n {\n allowAsThisParameter: false,\n allowInGenericTypeArguments: true,\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/require-await': [2],\n '@typescript-eslint/no-redundant-type-constituents': [2],\n '@typescript-eslint/no-unnecessary-type-arguments': [2],\n '@typescript-eslint/no-unnecessary-type-assertion': [\n 2,\n { typesToIgnore: [] },\n ],\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/no-inferrable-types': [\n 2,\n {\n ignoreParameters: false,\n ignoreProperties: false,\n },\n ],\n '@typescript-eslint/no-require-imports': [\n 2,\n {\n allow: [],\n allowAsImport: true,\n },\n ],\n 'object-shorthand': [\n 2,\n 'always',\n {\n avoidExplicitReturnArrows: true,\n avoidQuotes: true,\n ignoreConstructors: true,\n methodsIgnorePattern: '',\n },\n ],\n\n ...disabledRules,\n },\n\n linterOptions: {\n reportUnusedDisableDirectives: 2,\n },\n } as const satisfies TSESLint.FlatConfig.Config satisfies Linter.Config,\n\n {\n name: `${packageName}/commonjs-files`,\n files: ['**/*.cjs'],\n languageOptions: {\n sourceType: 'commonjs',\n },\n rules: {\n '@typescript-eslint/no-require-imports': [\n 0,\n {\n allow: [],\n allowAsImport: false,\n },\n ],\n },\n } as const satisfies TSESLint.FlatConfig.Config satisfies Linter.Config,\n\n prettierConfig,\n )\n","import type { TSESLint } from '@typescript-eslint/utils'\nimport type { ConfigWithExtends } from './external.js'\nimport { config } 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: ConfigWithExtends[] = [],\n): TSESLint.FlatConfig.Config[] =>\n /* @__PURE__ */ config(...flatESLintConfig, ...additionalOverrides)\n"],"mappings":";AASO,IAAM,gBAAgB;AAAA,EAC3B,YAAY,CAAC,GAAG,EAAE,QAAQ,MAAM,CAAC;AAAA,EACjC,qCAAqC;AAAA,IACnC;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,mBAAmB;AAAA,MACnB,cAAc;AAAA,MACd,2BAA2B;AAAA,MAC3B,gCAAgC;AAAA,MAChC,mBAAmB;AAAA,MACnB,oBAAoB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oB;AAAA,UACpB,sBAAsB;AAAA,QACxB;AAAA,MACF;AAAA,MAEA,GAAG;AAAA,IACL;AAAA,IAEA,eAAe;AAAA,MACb,+BAA+B;AAAA,IACjC;AAAA,EACF;AAAA,EAEA;AAAA,IACE,MAAM,GAAG,WAAW;AAAA,IACpB,OAAO,CAAC,UAAU;AAAA,IAClB,iBAAiB;AAAA,MACf,YAAY;AAAA,IACd;AAAA,IACA,OAAO;AAAA,MACL,yCAAyC;AAAA,QACvC;AAAA,QACA;AAAA,UACE,OAAO,CAAC;AAAA,UACR,eAAe;AAAA,QACjB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EAEA;AACF;;;AC5JK,IAAM,qBAAqB,CAChC,sBAA2C,CAAC,MAE5B,uBAAO,GAAG,kBAAkB,GAAG,mBAAmB;","names":[]}
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,YAAY,CACV,GACA,EACE,QAAQ,OACT,CACF;CACF;;;;AClCD,MAAa,EAAE,SAAS,MAAM,aAAa,WAAW;;;;;;;;;;;;;;;;AEJtD,MAAa,gBAAgB;CAC3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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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.5",
3
+ "version": "0.0.7",
4
4
  "description": "ESLint configuration for TypeScript projects",
5
5
  "keywords": [
6
6
  "eslint",
@@ -55,38 +55,44 @@
55
55
  "src"
56
56
  ],
57
57
  "scripts": {
58
- "build": "tsup --config=$INIT_CWD/tsup.config.mts",
59
- "check-exports": "attw --pack $INIT_CWD",
60
- "check-package-json": "publint --strict $INIT_CWD",
61
- "clean": "rimraf $INIT_CWD/dist/",
58
+ "build": "yarn run clean && tsdown --config-loader='unrun' --config=\"${INIT_CWD}/tsdown.config.mts\"",
59
+ "check-exports": "attw --pack ${INIT_CWD}",
60
+ "check-package-json": "publint --strict ${INIT_CWD}",
61
+ "clean": "rimraf ${INIT_CWD}/dist/ ${INIT_CWD}/.rolldown/",
62
62
  "format-check": "yarn run -T format-check",
63
63
  "format": "yarn run -T format",
64
64
  "lint-fix": "yarn run -T lint-fix",
65
65
  "lint": "yarn run -T lint",
66
- "prepack": "yarn clean && yarn build",
67
- "test-types": "tsc -p $INIT_CWD/tsconfig.json"
66
+ "prepack": "yarn run build",
67
+ "typecheck": "tsc -p ${INIT_CWD}/tsconfig.json"
68
68
  },
69
69
  "dependencies": {
70
- "@eslint/js": "^9.27.0",
71
- "@typescript-eslint/utils": "^8.32.1",
72
- "eslint-config-prettier": "^10.1.5",
73
- "globals": "^16.1.0",
74
- "typescript-eslint": "^8.32.1"
70
+ "@eslint/js": "^9.39.2",
71
+ "@typescript-eslint/utils": "^8.55.0",
72
+ "eslint-config-prettier": "^10.1.8",
73
+ "globals": "^17.3.0",
74
+ "typescript-eslint": "^8.55.0"
75
75
  },
76
76
  "devDependencies": {
77
- "@arethetypeswrong/cli": "^0.18.1",
78
- "@aryaemami59/tsconfig": "^0.0.5",
79
- "eslint": "^9.27.0",
80
- "publint": "^0.3.12",
81
- "rimraf": "^6.0.1",
82
- "tsup": "^8.5.0",
83
- "typescript": "^5.8.3"
77
+ "@arethetypeswrong/cli": "^0.18.2",
78
+ "@aryaemami59/tsconfig": "workspace:^",
79
+ "@eslint/core": "^1.1.0",
80
+ "@types/node": "^25.2.3",
81
+ "eslint": "^9.39.2",
82
+ "publint": "^0.3.17",
83
+ "rimraf": "^6.1.2",
84
+ "tsdown": "^0.20.3",
85
+ "typescript": "^5.9.3"
84
86
  },
85
87
  "peerDependencies": {
86
- "eslint": ">=8.56.0",
88
+ "@eslint/core": "*",
89
+ "eslint": "^9 || ^10",
87
90
  "typescript": "*"
88
91
  },
89
92
  "peerDependenciesMeta": {
93
+ "@eslint/core": {
94
+ "optional": true
95
+ },
90
96
  "eslint": {
91
97
  "optional": true
92
98
  },
@@ -97,5 +103,8 @@
97
103
  "publishConfig": {
98
104
  "access": "public",
99
105
  "provenance": true
106
+ },
107
+ "optionalDependencies": {
108
+ "@eslint/core": "*"
100
109
  }
101
- }
110
+ }
@@ -1,4 +1,4 @@
1
- import type { Linter } from 'eslint'
1
+ import type { Linter } from './external.js'
2
2
 
3
3
  /**
4
4
  * An object comprised of ESLint rules to disable.
@@ -8,30 +8,49 @@ import type { Linter } from 'eslint'
8
8
  * @public
9
9
  */
10
10
  export const disabledRules = {
11
- 'no-undef': [0, { typeof: false }],
11
+ '@typescript-eslint/ban-ts-comment': [
12
+ 0,
13
+ {
14
+ minimumDescriptionLength: 3,
15
+ 'ts-check': false,
16
+ 'ts-expect-error': 'allow-with-description',
17
+ 'ts-ignore': true,
18
+ 'ts-nocheck': true,
19
+ },
20
+ ],
21
+
22
+ // TODO: Remove this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.
23
+ '@typescript-eslint/consistent-generic-constructors': [0],
24
+
12
25
  '@typescript-eslint/no-unused-vars': [
13
26
  0,
14
27
  {
15
- args: 'all',
28
+ args: 'after-used',
29
+ // Not included in default options
16
30
  argsIgnorePattern: '^_',
17
31
  caughtErrors: 'all',
32
+ // Not included in default options
18
33
  caughtErrorsIgnorePattern: '^_',
34
+ // Not included in default options
19
35
  destructuredArrayIgnorePattern: '^_',
36
+ ignoreClassWithStaticInitBlock: false,
37
+ ignoreRestSiblings: false,
38
+ reportUsedIgnorePattern: false,
39
+ vars: 'all',
40
+ // Not included in default options
20
41
  varsIgnorePattern: '^_',
21
- ignoreRestSiblings: true,
22
42
  },
23
43
  ],
24
- '@typescript-eslint/ban-ts-comment': [
44
+ 'no-undef': [
25
45
  0,
26
46
  {
27
- 'ts-expect-error': 'allow-with-description',
28
- 'ts-ignore': true,
29
- 'ts-nocheck': true,
30
- 'ts-check': false,
31
- minimumDescriptionLength: 3,
47
+ typeof: false,
32
48
  },
33
49
  ],
34
50
  } as const satisfies Linter.RulesRecord satisfies Record<
35
51
  keyof Linter.RulesRecord,
36
- [Extract<Linter.Severity, 0>, ...(readonly unknown[])]
52
+ [
53
+ ruleSeverity: Extract<Linter.Severity, 0>,
54
+ ...ruleOptions: readonly unknown[],
55
+ ]
37
56
  >
package/src/external.ts CHANGED
@@ -1,10 +1,16 @@
1
1
  import js from '@eslint/js'
2
2
  import prettierConfig from 'eslint-config-prettier/flat'
3
+ import globalIdentifiers from 'globals'
4
+ export type { Linter } from 'eslint'
5
+ export { defineConfig } from 'eslint/config'
6
+ export type { Config } from 'eslint/config'
3
7
  export { config, configs, parser, plugin } from 'typescript-eslint'
4
8
  export type {
5
- Config,
6
9
  ConfigArray,
7
10
  ConfigWithExtends,
11
+ FlatConfig,
8
12
  InfiniteDepthConfigWithExtends,
13
+ Config as TSESlintConfig,
9
14
  } from 'typescript-eslint'
10
15
  export { js, prettierConfig }
16
+ export const { browser, node, nodeBuiltin, vitest } = globalIdentifiers
@@ -1,6 +1,5 @@
1
- import type { TSESLint } from '@typescript-eslint/utils'
2
- import type { Linter } from 'eslint'
3
- import { packageName } from './packageName.js'
1
+ import packageJson from '../package.json' with { type: 'json' }
2
+ import type { Config } from './external.js'
4
3
 
5
4
  /**
6
5
  * An object representing
@@ -11,21 +10,23 @@ import { packageName } from './packageName.js'
11
10
  * @public
12
11
  */
13
12
  export const globalIgnores = {
14
- name: `${packageName}/global-ignores`,
15
13
  ignores: [
16
- '**/dist/',
17
- '**/build/',
18
- '**/lib/',
19
- '**/coverage/',
20
14
  '**/__snapshots__/',
21
- '**/temp/',
15
+ '**/.docusaurus/',
16
+ '**/.expo/',
17
+ '**/.next/',
18
+ '**/.playwright/',
22
19
  '**/.temp/',
23
20
  '**/.tmp/',
21
+ '**/.turbo/',
22
+ '**/.wrangler/',
24
23
  '**/.yalc/',
25
24
  '**/.yarn/',
26
- '**/.docusaurus/',
27
- '**/.next/',
28
- '**/.expo/',
29
25
  '**/*.snap',
26
+ '**/build/',
27
+ '**/coverage/',
28
+ '**/dist/',
29
+ '**/temp/',
30
30
  ],
31
- } as const satisfies TSESLint.FlatConfig.Config satisfies Linter.Config
31
+ name: `${packageJson.name}/global-ignores`,
32
+ } as const satisfies Config
package/src/globals.ts CHANGED
@@ -1,7 +1,5 @@
1
- import type { Linter } from 'eslint'
2
- import globalIdentifiers from 'globals'
3
-
4
- const { browser, node, nodeBuiltin, vitest } = globalIdentifiers
1
+ import type { Linter } from './external.js'
2
+ import { browser, node, nodeBuiltin, vitest } from './external.js'
5
3
 
6
4
  /**
7
5
  * An object representing the
@@ -12,23 +10,23 @@ const { browser, node, nodeBuiltin, vitest } = globalIdentifiers
12
10
  * @public
13
11
  */
14
12
  export const vitestGlobals = {
15
- suite: 'writable',
16
- test: 'writable',
17
- chai: 'writable',
18
- describe: 'writable',
19
- it: 'writable',
20
- expectTypeOf: 'writable',
21
- assertType: 'writable',
22
- expect: 'writable',
13
+ afterAll: 'writable',
14
+ afterEach: 'writable',
23
15
  assert: 'writable',
24
- vitest: 'writable',
25
- vi: 'writable',
16
+ assertType: 'writable',
26
17
  beforeAll: 'writable',
27
- afterAll: 'writable',
28
18
  beforeEach: 'writable',
29
- afterEach: 'writable',
19
+ chai: 'writable',
20
+ describe: 'writable',
21
+ expect: 'writable',
22
+ expectTypeOf: 'writable',
23
+ it: 'writable',
30
24
  onTestFailed: 'writable',
31
25
  onTestFinished: 'writable',
26
+ suite: 'writable',
27
+ test: 'writable',
28
+ vi: 'writable',
29
+ vitest: 'writable',
32
30
  } as const satisfies Linter.Globals satisfies Record<
33
31
  keyof typeof vitest,
34
32
  Extract<Linter.GlobalConf, 'writable'>
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,
@@ -11,7 +12,10 @@ export type {
11
12
  Config,
12
13
  ConfigArray,
13
14
  ConfigWithExtends,
15
+ FlatConfig,
14
16
  InfiniteDepthConfigWithExtends,
17
+ Linter,
18
+ TSESlintConfig,
15
19
  } from './external.js'
16
20
  export { globalIgnores } from './globalIgnores.js'
17
21
  export { globals, vitestGlobals } from './globals.js'
@@ -1,3 +1,5 @@
1
+ import packageJson from '../package.json' with { type: 'json' }
2
+
1
3
  /**
2
4
  * This is used because if we import the package name from the
3
5
  * `package.json` file, it will be bundled into the final output,
@@ -6,4 +8,4 @@
6
8
  * @since 0.0.5
7
9
  * @internal
8
10
  */
9
- export const packageName = '@aryaemami59/eslint-config'
11
+ export const packageJsonName = packageJson.name