Skip to content

Instantly share code, notes, and snippets.

@snaptopixel
Created March 1, 2019 16:40
Show Gist options
  • Save snaptopixel/6ea3855e1acda57d0ef1994b87955ced to your computer and use it in GitHub Desktop.
Save snaptopixel/6ea3855e1acda57d0ef1994b87955ced to your computer and use it in GitHub Desktop.
TSLint and Prettier setup for Stencil
trailingComma: all
semi: true
singleQuote: true
jsxSingleQuote: true
endOfLine: lf
proseWrap: never
{
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"src/**/*.ts?(x)": [
"tslint --fix",
"prettier --write",
"git add"
]
},
"scripts": {
"lint": "tslint \"src/**/*.ts?(x)\"",
"pretty": "prettier --write \"src/**/*.ts?(x)\""
},
"devDependencies": {
"husky": "^1.3.1",
"lint-staged": "^8.1.0",
"prettier": "^1.16.1",
"tslint": "^5.12.1",
"tslint-config-prettier": "^1.17.0",
"tslint-stencil": "^1.0.0"
}
}
{
"compilerOptions": {
"strict": true,
"strictPropertyInitialization": false,
"strictNullChecks": false,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"esModuleInterop": true,
"lib": [
"dom",
"dom.iterable",
"es2017"
],
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
},
"moduleResolution": "node",
"module": "esnext",
"target": "es2017",
"jsx": "react",
"jsxFactory": "h"
},
"include": [
"src"
],
"exclude": [
"node_modules"
]
}
{
"rules": {
"interface-name": [true, "always-prefix"],
"max-classes-per-file": false,
"member-access": false,
"member-ordering": false,
"function-constructor": false,
"no-implicit-dependencies": false,
"no-namespace": false,
"no-submodule-imports": false,
"object-literal-sort-keys": false,
"no-empty-interface": false,
"ordered-imports": [true, {
"import-sources-order": "case-insensitive",
"named-imports-order": "case-insensitive",
"grouped-imports": true
}],
"lifecycle-order": [true, "call-order"],
"stencil-method-order": [true, {
"order": ["hostData", "render"]
}],
"component-member-order": [
true,
{
"order": [
"element",
"event",
"internal-prop",
"prop",
"watched-prop",
"state",
"own-prop",
"own-method",
"method",
"watch",
"listen",
"lifecycle",
"stencil-method"
],
"alphabetical": false
}
]
},
"extends": [
"tslint:latest",
"tslint-config-prettier",
"tslint-stencil"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment