1.2.2 • Published 5 years ago
eslint-config-frontwerk-typescript v1.2.2
eslint-config-frontwerk-typescript
This package provides Frontwerk's TypeScript .eslintrc as an extensible shared ESLint config.
Usage
- Install the versions of the package, including its
peerDependencies:
npm install --dev eslint-config-frontwerk-typescript @typescript-eslint/{eslint-plugin,parser} eslint eslint-plugin-import typescriptOr with yarn:
yarn add --dev eslint-config-frontwerk-typescript @typescript-eslint/{eslint-plugin,parser} eslint eslint-plugin-import typescript- Extend your desired config file in your
.eslintrc. We expose two configurations:
Semantic rules use the TypeScript compiler to inspect static types and validate code patterns. These rules require that a valid tsconfig.json file be present and referenced in your
parserOptions'sprojectinside of your.eslintrc. When using the recommended (default) config, be sure to pass atsconfig.jsonin your.eslintrc.
- The recommended (default) config that includes the TypeScript rules that require type checking. Add
"extends": "frontwerk-typescript"to your.eslintrc.
{ "extends": ["frontwerk-typescript", "plugin:import/typescript"], "parserOptions": { "project": "./tsconfig.json" }, }
- A config without the TypeScript rules that require type checking. Add
"extends": "frontwerk-typescript/no-type-checking"to your.eslintrc. - A config with the TypeScript rules that are stricter. Add
"extends": "frontwerk-typescript/strict"to your.eslintrc.
Related
eslint-config-frontwerk-typescriptis based on the ESLint rules defined in eslint-config-frontwerk.- If you're using ReactJS, check out eslint-config-frontwerk-react.
Contributing
- Run tests with
npm run testoryarn test. - Run the lint with
npm run lintoryarn lint.
For details, check out the Contributing guide.
LICENSE
MIT