@bravobit/eslint-config
v0.3.0
Published
Bravobit's shared ESLint flat config: stylistic conventions, type-checked typescript-eslint rules, and waterfall sorting for TypeScript and CSS/SCSS.
Downloads
97
Maintainers
Readme
@bravobit/eslint-config
Bravobit's shared ESLint flat config. One import gives you:
- Formatting via
@stylistic/eslint-plugin— 4-space indent, single quotes, semicolons, no spaces inside braces/brackets/parens ({inject},['token'],next('completed')), no trailing commas,x => ...arrow parens, padded class bodies,1tbsbraces, operators at the start of wrapped lines, and more. Everything is auto-fixable. - Consistency —
constoverlet/var,===, object shorthand, template literals over string concatenation,interfaceovertype,string[]overArray<string>, no redundant type annotations (count: number = 0), generics on the constructor (new Map<string, number>()),readonlyon never-reassigned private members,a?.bovera && a.b, and no yoda conditions (value === undefinedoverundefined === value). All auto-fixable except===. - Type-aware linting via
typescript-eslintrecommendedTypeChecked— floating promises, misused promises, await of non-thenables, etc. Theno-unsafe-*family is off by default untilanyboundaries are typed; re-enable it per project as modules get cleaned up. - Waterfall sorting via
@bravobit/eslint-plugin-waterfallfor imports and CSS/SCSS declarations.
Install
npm install --save-dev eslint @bravobit/eslint-configThe plugins (@stylistic/eslint-plugin, typescript-eslint, @bravobit/eslint-plugin-waterfall) come along as dependencies — no need to install them separately.
Use
eslint.config.mjs:
import {defineConfig, globalIgnores} from 'eslint/config';
import bravobit from '@bravobit/eslint-config';
export default defineConfig(
globalIgnores(['deployment/', 'scripts/']), // project-specific extras; dist/, coverage/ and .angular/ are already ignored
bravobit
);Type-aware rules use typescript-eslint's projectService, which finds the nearest tsconfig.json automatically — no per-project parser configuration needed.
Override
Flat config merges left to right, so append a block to tighten or loosen rules per project:
export default defineConfig(
bravobit,
{
files: ['src/app/payments/**/*.ts'],
rules: {
// e.g. re-enable the unsafe family for a cleaned-up module
'@typescript-eslint/no-unsafe-assignment': 'warn'
}
}
);