eslint-config-ruppy-ts v2.0.0
eslint-config-ruppy-ts 💪🏻
Ruppy's eslint extension configs for Typescript projects
Description
This eslint configurations is the extension of ruppy-configs for typescript project.
ruppy-ts
This is the default configs. It contains recommended rules from plugin and the extension rules from the plugin, also personal preferences.
Important: it needs tsconfig.json in your project. The path default to looked up
in your root project (process.cwd()). If you have another location of tsconfig.json,
you should add this settings in your .eslintrc.js:
module.exports = {
extends: ['ruppy-react/ts', 'ruppy-ts'],
env: { browser: true, jest: true },
+ parserOptions: {
+ // it accepts string, string[], or glob pattern
+ project: '**/{!(node_modules)/**,**}/tsconfig.json',
+ },
+ settings: {
+ 'import/resolver': {
+ typescript: {
+ // it accept string, string[], or glob pattern
+ project: 'path/to/tsconfig.json',
+ },
+ },
+ },
}Usage
The easiest way to add this configs into project is running this commands in your root project:
npx eslint-ruppy -i
OR follow along these steps below:
This configs needs another config. This config only extension. Example use along with ruppy-react:
Install this configs and its peer dependencies.
yarn add -D eslint-config-ruppy-react eslint-config-ruppy-ts eslint prettier typescriptor
npm install -D eslint-config-ruppy-react eslint-config-ruppy-ts eslint prettier typescriptCreate
.eslintrc.jsfile in the root project and extends the configs. Also set the environment your project would live on.require("eslint-config-ruppy-react/patch"); module.exports = { extends: ["ruppy-react/ts, ruppy-ts"], env: {}, };An environment defines global variables that are predefined. See eslint configurations guide for available environments.
Optionally create prettier configuration file for the code styles,
.prettierrc:{ "overrides": [ { "files": "*.{js,jsx,ts,tsx}", "options": { "singleQuote": true } } ] }See all available prettier options and how to write configuration files to see more info on that.