Skip to content

Configs Reference

License NPM Version Open Issues

⚙️ Shared project configuration files for linting, formatting, documentation and so on.

Configurations

Usage

All this configurations are setup automatically by @lou.codes/create-package when creating a new package.

For manual setup of each file, use the examples below:

.changeset/config.json
{
"$schema": "https://raw.githubusercontent.com/changesets/changesets/main/packages/config/schema.json",
"changelog": "@lou.codes/configs/changelog.cjs",
"commit": false,
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch"
}
eslint.config.js
export { default } from "@lou.codes/configs/eslint.config.js";
prettier.config.js
export { default } from "@lou.codes/configs/prettier.config.js";
stylelint.config.js
export { default } from "@lou.codes/configs/stylelint.config.js";
tsconfig.json
{
"extends": "@lou.codes/configs/typescript.config.json"
}
typedoc.json
{
"$schema": "https://typedoc.org/schema.json",
"cname": "PUBLIC DOMAIN",
"entryPoints": ["./lib"],
"extends": ["@lou.codes/configs/typedoc.config.json"],
"name": "PACKAGE NAME"
}
  • Changelog: List of changes between versions.

Variables

changesetsConfig

Const changesetsConfig: Readonly<{ getDependencyReleaseLine: (_changesets: NewChangesetWithCommit[], dependenciesUpdated: ModCompWithPackage[]) => Promise<string> ; getReleaseLine: ({ summary }: NewChangesetWithCommit) => Promise<string> }>


eslintConfig

Const eslintConfig: readonly [Readonly<{ files: ["**/*.cjs", "**/*.cts", "**/*.js", "**/*.jsx", "**/*.mjs", "**/*.mts", "**/*.ts", "**/*.tsx"] ; rules: { array-callback-return: 2 ; arrow-body-style: 2 ; arrow-parens: [2, "as-needed"] ; capitalized-comments: [2, "always", { ignoreConsecutiveComments: true }] ; class-methods-use-this: 2 ; complexity: [2, 20] ; consistent-return: 2 ; curly: 2 ; default-case: 2 ; default-case-last: 2 ; default-param-last: 2 ; eqeqeq: 2 ; grouped-accessor-pairs: 2 ; guard-for-in: 2 ; id-denylist: [2, "auth", "btn", "cb", "char", "desc", "dest", "dir", "e", "elem", "er", "err", "ev", "evt", "fn", "i", "img", "obj", "opt", "opts", "param", "params", "prev", "prop", "props", "req", "res", "src", "str", "temp", "tmp", "val"] ; id-length: [2, { exceptions: readonly ["_", "x", "y", "z"] }] ; max-classes-per-file: [2, 1] ; max-lines: [2, { max: 300 ; skipBlankLines: true ; skipComments: true }] ; max-params: [2, 3] ; new-parens: 2 ; no-alert: 2 ; no-bitwise: 1 ; no-caller: 2 ; no-console: 1 ; no-constructor-return: 2 ; no-eval: 2 ; no-extend-native: 2 ; no-extra-bind: 2 ; no-floating-decimal: 2 ; no-implicit-coercion: 2 ; no-import-assign: 2 ; no-lone-blocks: 2 ; no-multi-spaces: 2 ; no-multi-str: 2 ; no-multiple-empty-lines: [2, { max: 1 }] ; no-negated-condition: 2 ; no-new-func: 2 ; no-new-wrappers: 2 ; no-param-reassign: 2 ; no-plusplus: 2 ; no-proto: 2 ; no-return-await: 2 ; no-self-compare: 2 ; no-template-curly-in-string: 2 ; no-unmodified-loop-condition: 2 ; no-unneeded-ternary: 2 ; no-unreachable-loop: 2 ; no-useless-call: 2 ; no-useless-concat: 2 ; no-useless-return: 2 ; no-var: 2 ; object-shorthand: 2 ; one-var: [2, "never"] ; padding-line-between-statements: [2, { blankLine: "always" ; next: "return" ; prev: "*" }, { blankLine: "always" ; next: "*" ; prev: readonly ["import", "const", "let", "var"] }, { blankLine: "any" ; next: readonly ["const", "let", "var"] ; prev: readonly ["const", "let", "var"] }, { blankLine: "any" ; next: "import" ; prev: "import" }, { blankLine: "always" ; next: "export" ; prev: "*" }, { blankLine: "any" ; next: "export" ; prev: "export" }] ; prefer-arrow-callback: 2 ; prefer-const: 2 ; prefer-exponentiation-operator: 1 ; prefer-named-capture-group: 1 ; prefer-object-spread: 1 ; prefer-regex-literals: 2 ; prefer-rest-params: 2 ; prefer-spread: 2 ; prefer-template: 2 ; radix: 2 ; require-unicode-regexp: 2 ; sort-keys: [2, "asc", { natural: true }] ; spaced-comment: 2 ; wrap-iife: [2, "inside"] ; yoda: 2 } }>, Readonly<{ languageOptions: { parser: Linter.ParserModule ; parserOptions: { ecmaFeatures: { impliedStrict: true ; jsx: true } ; ecmaVersion: "latest" ; project: true ; sourceType: "module" } } ; plugins: { @typescript-eslint: ESLint.Plugin & { configs: { recommended: Linter.FlatConfig } } } ; rules: { @typescript-eslint/adjacent-overload-signatures: 2 ; @typescript-eslint/array-type: [2, { default: "generic" }] ; @typescript-eslint/await-thenable: 2 ; @typescript-eslint/ban-ts-comment: [2, { ts-check: false ; ts-expect-error: "allow-with-description" ; ts-ignore: true ; ts-nocheck: true }] ; @typescript-eslint/ban-tslint-comment: 2 ; @typescript-eslint/ban-types: [2, { types: { Boolean: { fixWith: "boolean" ; message: "Use `boolean` instead." } ; Function: false ; Number: { fixWith: "number" ; message: "Use `number` instead." } ; Object: { fixWith: "object" ; message: "Use `object` instead." } ; String: { fixWith: "string" ; message: "Use `string` instead." } ; Symbol: { fixWith: "symbol" ; message: "Use `symbol` instead." } } }] ; @typescript-eslint/consistent-indexed-object-style: [2, "record"] ; @typescript-eslint/consistent-type-assertions: [2, { assertionStyle: "as" ; objectLiteralTypeAssertions: "allow" }] ; @typescript-eslint/consistent-type-definitions: [2, "type"] ; @typescript-eslint/consistent-type-imports: [2, { fixStyle: "inline-type-imports" }] ; @typescript-eslint/dot-notation: 2 ; @typescript-eslint/explicit-function-return-type: 0 ; @typescript-eslint/explicit-member-accessibility: [2, { accessibility: "explicit" ; overrides: { accessors: "explicit" ; constructors: "explicit" } }] ; @typescript-eslint/explicit-module-boundary-types: 0 ; @typescript-eslint/init-declarations: 2 ; @typescript-eslint/member-ordering: 2 ; @typescript-eslint/method-signature-style: [2, "property"] ; @typescript-eslint/naming-convention: [2, { format: null ; leadingUnderscore: "allow" ; selector: "default" ; trailingUnderscore: "forbid" }, { format: readonly ["camelCase", "PascalCase", "UPPER_CASE"] ; selector: readonly ["variable", "enumMember"] }, { format: readonly ["camelCase", "PascalCase"] ; selector: "function" }, { format: readonly ["camelCase"] ; leadingUnderscore: "allow" ; selector: readonly ["parameter", "classProperty", "classMethod"] ; trailingUnderscore: "forbid" }, { format: readonly ["PascalCase"] ; leadingUnderscore: "forbid" ; selector: readonly ["class", "enum", "interface", "typeAlias", "typeLike", "typeParameter"] }] ; @typescript-eslint/no-array-constructor: 2 ; @typescript-eslint/no-base-to-string: 2 ; @typescript-eslint/no-dupe-class-members: 0 ; @typescript-eslint/no-dynamic-delete: 2 ; @typescript-eslint/no-empty-function: 2 ; @typescript-eslint/no-empty-interface: 2 ; @typescript-eslint/no-explicit-any: 2 ; @typescript-eslint/no-extraneous-class: 2 ; @typescript-eslint/no-floating-promises: 2 ; @typescript-eslint/no-for-in-array: 2 ; @typescript-eslint/no-implied-eval: 2 ; @typescript-eslint/no-inferrable-types: 0 ; @typescript-eslint/no-invalid-this: 2 ; @typescript-eslint/no-invalid-void-type: 2 ; @typescript-eslint/no-loop-func: 2 ; @typescript-eslint/no-loss-of-precision: 2 ; @typescript-eslint/no-meaningless-void-operator: 2 ; @typescript-eslint/no-misused-new: 2 ; @typescript-eslint/no-misused-promises: 2 ; @typescript-eslint/no-namespace: 2 ; @typescript-eslint/no-non-null-asserted-nullish-coalescing: 2 ; @typescript-eslint/no-non-null-assertion: 2 ; @typescript-eslint/no-redeclare: 0 ; @typescript-eslint/no-redundant-type-constituents: 2 ; @typescript-eslint/no-require-imports: 2 ; @typescript-eslint/no-shadow: [2, { allow: readonly ["_"] ; hoist: "all" }] ; @typescript-eslint/no-this-alias: 2 ; @typescript-eslint/no-throw-literal: 2 ; @typescript-eslint/no-unnecessary-boolean-literal-compare: 2 ; @typescript-eslint/no-unnecessary-condition: 2 ; @typescript-eslint/no-unnecessary-type-arguments: 2 ; @typescript-eslint/no-unnecessary-type-assertion: 2 ; @typescript-eslint/no-unnecessary-type-constraint: 2 ; @typescript-eslint/no-unsafe-argument: 2 ; @typescript-eslint/no-unsafe-assignment: 2 ; @typescript-eslint/no-unsafe-call: 2 ; @typescript-eslint/no-unsafe-member-access: 2 ; @typescript-eslint/no-unsafe-return: 2 ; @typescript-eslint/no-unused-expressions: 2 ; @typescript-eslint/no-unused-vars: 0 ; @typescript-eslint/no-use-before-define: 2 ; @typescript-eslint/no-useless-constructor: 2 ; @typescript-eslint/no-useless-empty-export: 2 ; @typescript-eslint/no-var-requires: 2 ; @typescript-eslint/prefer-as-const: 2 ; @typescript-eslint/prefer-for-of: 2 ; @typescript-eslint/prefer-function-type: 2 ; @typescript-eslint/prefer-includes: 2 ; @typescript-eslint/prefer-namespace-keyword: 2 ; @typescript-eslint/prefer-nullish-coalescing: 2 ; @typescript-eslint/prefer-optional-chain: 2 ; @typescript-eslint/prefer-readonly: 2 ; @typescript-eslint/prefer-string-starts-ends-with: 2 ; @typescript-eslint/prefer-ts-expect-error: 2 ; @typescript-eslint/require-array-sort-compare: 2 ; @typescript-eslint/require-await: 2 ; @typescript-eslint/restrict-plus-operands: 2 ; @typescript-eslint/restrict-template-expressions: [2, { allowNumber: true }] ; @typescript-eslint/strict-boolean-expressions: 2 ; @typescript-eslint/switch-exhaustiveness-check: 2 ; @typescript-eslint/triple-slash-reference: 2 ; @typescript-eslint/unbound-method: 2 ; @typescript-eslint/unified-signatures: 2 ; camelcase: 0 ; dot-notation: 0 ; id-match: 0 ; init-declarations: 0 ; no-extra-boolean-cast: 0 ; no-implied-eval: 0 ; no-loop-func: 0 ; no-redeclare: 0 ; no-shadow: 0 ; no-throw-literal: 0 ; no-undef: 0 ; no-undef-init: 0 ; no-unused-expressions: 0 ; no-use-before-define: 0 ; no-useless-constructor: 0 ; require-await: 0 } }>, Linter.FlatConfig, { plugins: { functional: ESLint.Plugin & { configs: { recommended: Linter.FlatConfig } } } ; rules: { @typescript-eslint/prefer-readonly-parameter-types: 0 ; functional/functional-parameters: [2, { allowArgumentsKeyword: false ; allowRestParameter: true ; enforceParameterCount: false }] ; functional/no-expression-statements: [2, { ignoreCodePattern: readonly ["\\?\\.\\(", "\\s*yield", "\\w+\\s*=\\s*.", "\\s*void"] ; ignoreVoid: true }] ; functional/no-mixed-types: 1 ; functional/no-return-void: [2, { allowNull: false ; allowUndefined: true ; ignoreInferredTypes: true }] ; functional/prefer-immutable-types: [2, { enforcement: "None" ; ignoreInferredTypes: true ; parameters: { enforcement: "ReadonlyShallow" } }] } }, Readonly<{ plugins: { import: ESLint.Plugin & { configs: { recommended: Linter.FlatConfig } } } ; rules: { import/exports-last: 2 ; import/first: 2 ; import/no-absolute-path: 2 ; import/no-cycle: 2 ; import/no-default-export: 2 ; import/no-extraneous-dependencies: 2 ; import/no-internal-modules: 0 ; import/no-mutable-exports: 2 ; import/no-named-as-default: 0 ; import/no-useless-path-segments: 2 ; import/no-webpack-loader-syntax: 2 } }>, Readonly<{ plugins: { prefer-arrow-functions: ESLint.Plugin & { configs: { recommended: Linter.FlatConfig } } } ; rules: { prefer-arrow-functions/prefer-arrow-functions: [2, { allowNamedFunctions: false ; classPropertiesAllowed: false ; disallowPrototype: false ; returnStyle: "implicit" ; singleReturnOnly: false }] } }>, Readonly<{ plugins: { prettier: ESLint.Plugin & { configs: { recommended: Linter.FlatConfig } } } ; rules: { @typescript-eslint/comma-dangle: 0 ; comma-dangle: 0 ; eol-last: 0 ; linebreak-style: 0 ; max-len: 0 ; newline-per-chained-call: 0 ; no-mixed-spaces-and-tabs: 0 ; no-trailing-spaces: 0 ; no-unexpected-multiline: 0 ; quote-props: 0 } }>, Readonly<{ plugins: { react: ESLint.Plugin & { configs: { recommended: Linter.FlatConfig } } ; react-hooks: ESLint.Plugin & { configs: { recommended: Linter.FlatConfig } } } ; rules: { react/button-has-type: 2 ; react/function-component-definition: [2, { namedComponents: "arrow-function" ; unnamedComponents: "arrow-function" }] ; react/jsx-boolean-value: [2, "never"] ; react/jsx-curly-brace-presence: 2 ; react/jsx-fragments: [2, "syntax"] ; react/jsx-handler-names: 2 ; react/jsx-no-constructed-context-values: 2 ; react/jsx-no-script-url: 2 ; react/jsx-no-target-blank: 2 ; react/jsx-no-useless-fragment: 2 ; react/jsx-pascal-case: 2 ; react/jsx-sort-props: 2 ; react/no-array-index-key: 1 ; react/no-children-prop: 0 ; react/no-danger: 2 ; react/no-multi-comp: 2 ; react/no-this-in-sfc: 2 ; react/no-unsafe: 2 ; react/no-unstable-nested-components: 2 ; react/prefer-stateless-function: 2 ; react/prop-types: 0 ; react/react-in-jsx-scope: 0 } ; settings: { react: { version: "18" } } }>, Readonly<{ plugins: { unicorn: ESLint.Plugin & { configs: { recommended: Linter.FlatConfig } } } ; rules: { unicorn/better-regex: 2 ; unicorn/catch-error-name: 2 ; unicorn/consistent-destructuring: 2 ; unicorn/consistent-function-scoping: 2 ; unicorn/error-message: 2 ; unicorn/escape-case: 2 ; unicorn/no-abusive-eslint-disable: 2 ; unicorn/no-console-spaces: 2 ; unicorn/no-hex-escape: 2 ; unicorn/no-instanceof-array: 2 ; unicorn/no-invalid-remove-event-listener: 2 ; unicorn/no-negated-condition: 2 ; unicorn/no-new-array: 2 ; unicorn/no-new-buffer: 2 ; unicorn/no-null: 2 ; unicorn/no-unnecessary-polyfills: 2 ; unicorn/no-useless-fallback-in-spread: 2 ; unicorn/no-useless-length-check: 2 ; unicorn/no-useless-spread: 2 ; unicorn/no-useless-switch-case: 2 ; unicorn/number-literal-case: 2 ; unicorn/numeric-separators-style: 2 ; unicorn/prefer-add-event-listener: 2 ; unicorn/prefer-array-find: 2 ; unicorn/prefer-array-flat: 2 ; unicorn/prefer-array-flat-map: 2 ; unicorn/prefer-array-index-of: 2 ; unicorn/prefer-array-some: 2 ; unicorn/prefer-date-now: 2 ; unicorn/prefer-default-parameters: 2 ; unicorn/prefer-dom-node-append: 2 ; unicorn/prefer-dom-node-dataset: 2 ; unicorn/prefer-dom-node-remove: 2 ; unicorn/prefer-dom-node-text-content: 2 ; unicorn/prefer-event-target: 2 ; unicorn/prefer-export-from: 2 ; unicorn/prefer-includes: 2 ; unicorn/prefer-keyboard-event-key: 2 ; unicorn/prefer-logical-operator-over-ternary: 2 ; unicorn/prefer-modern-dom-apis: 2 ; unicorn/prefer-modern-math-apis: 2 ; unicorn/prefer-node-protocol: 2 ; unicorn/prefer-object-from-entries: 2 ; unicorn/prefer-optional-catch-binding: 2 ; unicorn/prefer-query-selector: 2 ; unicorn/prefer-spread: 2 ; unicorn/prefer-string-replace-all: 2 ; unicorn/prefer-string-slice: 2 ; unicorn/prefer-string-starts-ends-with: 2 ; unicorn/prefer-string-trim-start-end: 2 ; unicorn/prefer-ternary: 2 ; unicorn/prefer-type-error: 2 ; unicorn/require-array-join-separator: 2 ; unicorn/text-encoding-identifier-case: 2 } }>]


prettierConfig

Const prettierConfig: Readonly<{ arrowParens: "avoid" ; bracketSameLine: false ; bracketSpacing: true ; embeddedLanguageFormatting: "auto" ; endOfLine: "lf" ; experimentalTernaries: true ; htmlWhitespaceSensitivity: "strict" ; jsxSingleQuote: false ; printWidth: 80 ; proseWrap: "always" ; quoteProps: "as-needed" ; semi: true ; singleAttributePerLine: false ; singleQuote: false ; tabWidth: 4 ; trailingComma: "all" ; useTabs: true ; vueIndentScriptAndStyle: true }>


stylelintConfig

Const stylelintConfig: Readonly<{ defaultSeverity: "error" ; extends: ["stylelint-prettier/recommended"] ; plugins: [Plugin] ; rules: { alpha-value-notation: "number" ; at-rule-empty-line-before: readonly ["always", { except: readonly ["blockless-after-blockless", "first-nested"] ; ignore: readonly ["after-comment"] }] ; color-function-notation: "modern" ; color-hex-length: "short" ; color-named: "never" ; custom-property-pattern: "^[a-z][a-z0-9-]*$" ; declaration-no-important: true ; declaration-property-value-no-unknown: true ; font-weight-notation: "numeric" ; function-name-case: "lower" ; function-url-no-scheme-relative: true ; function-url-quotes: "always" ; function-url-scheme-allowed-list: readonly ["data", "/^http/"] ; hue-degree-notation: "angle" ; import-notation: "url" ; keyframe-selector-notation: "keyword" ; keyframes-name-pattern: "^[a-z][a-z0-9-]*$" ; length-zero-no-unit: true ; media-feature-range-notation: "context" ; order/properties-alphabetical-order: true ; rule-empty-line-before: readonly ["always", { except: readonly ["first-nested"] ; ignore: readonly ["after-comment"] }] ; selector-attribute-quotes: "always" ; selector-max-id: 1 ; selector-not-notation: "complex" ; selector-pseudo-element-colon-notation: "double" ; selector-type-case: "lower" ; shorthand-property-no-redundant-values: true ; value-keyword-case: readonly ["lower", { camelCaseSvgKeywords: true }] } }>


typedocConfig

typedocConfig: Object

Type declaration

NameType
$schemastring
disableSourcesboolean
entryPointsstring[]
extendsstring[]

typescriptConfig

typescriptConfig: Object

Type declaration

NameType
$schemastring
compilerOptions{ allowJs: boolean = true; alwaysStrict: boolean = true; checkJs: boolean = true; declaration: boolean = true; esModuleInterop: boolean = true; forceConsistentCasingInFileNames: boolean = true; jsx: string = “react”; jsxFactory: string = “createElement”; jsxFragmentFactory: string = “Fragment”; module: string = “NodeNext”; moduleResolution: string = “NodeNext”; newLine: string = “LF”; noEmitOnError: boolean = true; noUncheckedIndexedAccess: boolean = true; noUnusedLocals: boolean = true; noUnusedParameters: boolean = true; preserveConstEnums: boolean = true; preserveSymlinks: boolean = true; resolveJsonModule: boolean = true; skipLibCheck: boolean = true; strict: boolean = true; target: string = “ESNext”; useUnknownInCatchVariables: boolean = true; verbatimModuleSyntax: boolean = true }
compilerOptions.allowJsboolean
compilerOptions.alwaysStrictboolean
compilerOptions.checkJsboolean
compilerOptions.declarationboolean
compilerOptions.esModuleInteropboolean
compilerOptions.forceConsistentCasingInFileNamesboolean
compilerOptions.jsxstring
compilerOptions.jsxFactorystring
compilerOptions.jsxFragmentFactorystring
compilerOptions.modulestring
compilerOptions.moduleResolutionstring
compilerOptions.newLinestring
compilerOptions.noEmitOnErrorboolean
compilerOptions.noUncheckedIndexedAccessboolean
compilerOptions.noUnusedLocalsboolean
compilerOptions.noUnusedParametersboolean
compilerOptions.preserveConstEnumsboolean
compilerOptions.preserveSymlinksboolean
compilerOptions.resolveJsonModuleboolean
compilerOptions.skipLibCheckboolean
compilerOptions.strictboolean
compilerOptions.targetstring
compilerOptions.useUnknownInCatchVariablesboolean
compilerOptions.verbatimModuleSyntaxboolean