code-style-lint-ts
raw JSON → 3.1.1 verified Fri May 01 auth: no javascript
ESLint and Prettier shareable config for TypeScript projects, part of the code-style-lint family covering JS, Vue3, and React variants. At v3.1.1 (2023), it provides a zero-config preset that extends recommended rules for TypeScript and integrates Prettier. Weekly releases address dependency updates and framework support. It differentiates from alternatives like `eslint-config-airbnb` by being lighter, framework-agnostic (works with vanilla TS, Vue3, React), and tightly coupled with Prettier for formatting.
Common errors
error Error: Failed to load plugin '@typescript-eslint' declared in 'code-style-lint-ts' ↓
cause @typescript-eslint plugin not installed as peer dependency.
fix
npm install @typescript-eslint/eslint-plugin @typescript-eslint/parser -D
error Error: Cannot find module 'eslint-config-code-style-lint-ts' ↓
cause Extends uses full package name instead of short name.
fix
Use
"extends": ["code-style-lint-ts"] (without 'eslint-config-'). error Parsing error: ESLint was configured to run on `<tsconfigRootDir>/src/index.ts` using `parserOptions.project` ↓
cause Missing or incorrect tsconfig.json path.
fix
Set
parserOptions.project to "./tsconfig.json" or the correct path. error Error: Cannot find module 'prettier' ↓
cause Prettier not installed when code-style-lint-ts expects it.
fix
npm install prettier -D
Warnings
breaking From v3.0.0, the extends name changed from 'code-style-lint' to 'code-style-lint-ts' for TypeScript projects. ↓
fix Update extends in .eslintrc to `"code-style-lint-ts"` instead of `"code-style-lint"`.
deprecated Using `eslint-config-` prefix in extends array is deprecated; only use the short name. ↓
fix Use `"extends": ["code-style-lint-ts"]` without the `eslint-config-` prefix.
gotcha This package does not include TypeScript parser or plugin automatically; they must be installed as peer dependencies. ↓
fix Ensure `typescript` and `eslint` are in devDependencies.
gotcha Prettier config may conflict with ESLint's formatting rules if not properly integrated; code-style-lint-ts disables conflicting rules but requires `prettier` in dependencies. ↓
fix Install `prettier` as devDependency and optionally create `.prettierrc`.
breaking v2.x used a different package name `eslint-config-code-style-lint` without the `-ts` suffix; separate packages for JS/TS/Vue/React were introduced in v3. ↓
fix Switch to `eslint-config-code-style-lint-ts` for TypeScript projects.
Install
npm install eslint-config-code-style-lint-ts yarn add eslint-config-code-style-lint-ts pnpm add eslint-config-code-style-lint-ts Imports
- extends wrong
"extends": ["eslint-config-code-style-lint-ts"]correct"extends": ["code-style-lint-ts"]
Quickstart
// Install dependencies
npm install eslint-config-code-style-lint-ts eslint prettier typescript -D
// .eslintrc
{
"extends": ["code-style-lint-ts"],
"parserOptions": {
"project": "./tsconfig.json"
}
}
// .prettierrc (optional if code-style-lint-ts includes prettier config)
{
"singleQuote": true,
"trailingComma": "all"
}