Last active
January 19, 2019 14:53
-
-
Save katsu-o/fbae2c18b0c9e0b6efb4b92afd834c04 to your computer and use it in GitHub Desktop.
Settings of tslint/prettier after scaffolding by CRA(TypeScript)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create-react-app | |
> create-react-app --scripts-version=react-scripts-ts <your-project> | |
> cd <your-project> | |
# tslint, prettier | |
> yarn add --dev tslint prettier tslint-config-prettier tslint-config-airbnb tslint-plugin-prettier |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
..., | |
"scripts": { | |
..., | |
"tslint:prettier-check": "tslint-config-prettier-check ./tslint.json", | |
"tslint": "tslint --fix --force --format stylish --project ./tsconfig.json ./{src,__tests__}/**/*.{ts,tsx}", | |
"prettier": "prettier --write ./{src,__tests__}/**/*.{ts,tsx}" | |
}, | |
..., | |
"prettier": { | |
"semi": true, | |
"singleQuote": true, | |
"printWidth": 120, | |
"trailingComma": "es5" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"defaultSeverity": "error", | |
"rulesDirectory": ["tslint-plugin-prettier"], | |
"extends": ["tslint:latest", "tslint-react", "tslint-config-airbnb", "tslint-config-prettier"], | |
"linterOptions": { | |
"exclude": ["config/**/*.js", "node_modules/**/*.ts", "coverage/lcov-report/*.js"] | |
}, | |
"rules": { | |
"prettier": [ | |
true, | |
{ | |
"semi": true, | |
"singleQuote": true, | |
"printWidth": 120, | |
"trailingComma": "es5" | |
} | |
], | |
"no-console": false, | |
"variable-name": [ | |
true, | |
"ban-keywords", | |
"check-format", | |
"allow-pascal-case", | |
"allow-leading-underscore" | |
], | |
"import-name": false, | |
"ordered-imports": false, | |
"interface-name": false, | |
"no-empty-interface": false, | |
"object-literal-sort-keys": false, | |
"object-literal-shorthand": false, | |
"jsx-no-lambda": false, | |
"no-submodule-imports": [true, "excluded-module1", "excluded-module2"] | |
}, | |
"jsRules": {} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"editor.formatOnSave": true, | |
"tslint.autoFixOnSave": true, | |
"tslint.packageManager": "yarn", | |
"prettier.singleQuote": true, | |
"prettier.semi": true, | |
"prettier.printWidth": 120, | |
"prettier.trailingComma": "es5" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment