Skip to content

Instantly share code, notes, and snippets.

@fullpipe
Last active October 17, 2020 18:50
Show Gist options
  • Save fullpipe/79df8bd11cecd9ee192def166947b9e8 to your computer and use it in GitHub Desktop.
Save fullpipe/79df8bd11cecd9ee192def166947b9e8 to your computer and use it in GitHub Desktop.
Prettier set up for ionic framework

Install prettier

npm i -D tslint-config-prettier tslint-plugin-prettier prettier

Copy configs

curl https://gist.githubusercontent.com/fullpipe/79df8bd11cecd9ee192def166947b9e8/raw/2abd93d5ddba7de400667840269a1cdd601bda21/tslint.json > tslint.json

curl https://gist.githubusercontent.com/fullpipe/79df8bd11cecd9ee192def166947b9e8/raw/091d7911545c00540e4bb812aec81f30af9bf290/.prettierrc > .prettierrc

curl https://gist.githubusercontent.com/fullpipe/79df8bd11cecd9ee192def166947b9e8/raw/091d7911545c00540e4bb812aec81f30af9bf290/.prettierignore > .prettierignore
package.json
package-lock.json
{
"bracketSpacing": true,
"printWidth": 120,
"semi": true,
"singleQuote": true,
"tabWidth": 4,
"useTabs": false,
"arrowParens": "always",
"endOfLine": "lf",
"quoteProps": "consistent",
"trailingComma": "all"
}
{
"extends": ["tslint:recommended", "tslint-plugin-prettier", "tslint-config-prettier"],
"rules": {
"array-type": false,
"deprecation": {
"severity": "warning"
},
"component-class-suffix": [true, "Page", "Component"],
"contextual-lifecycle": true,
"directive-class-suffix": true,
"directive-selector": [true, "attribute", "app", "camelCase"],
"component-selector": [true, "element", "app", "kebab-case"],
"import-blacklist": [true, "rxjs/Rx"],
"max-classes-per-file": false,
"no-console": [true, "debug", "info", "time", "timeEnd", "trace"],
"no-empty": false,
"no-inferrable-types": [true, "ignore-params"],
"no-non-null-assertion": true,
"no-redundant-jsdoc": true,
"no-switch-case-fall-through": true,
"no-var-requires": false,
"object-literal-key-quotes": [true, "as-needed"],
"variable-name": {
"options": ["ban-keywords", "check-format", "allow-pascal-case"]
},
"whitespace": {
"options": [
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type",
"check-typecast"
]
},
"no-conflicting-lifecycle": true,
"no-host-metadata-property": true,
"no-input-rename": true,
"no-inputs-metadata-property": true,
"no-output-native": true,
"no-output-on-prefix": true,
"no-output-rename": true,
"no-outputs-metadata-property": true,
"template-banana-in-box": true,
"template-no-negated-async": true,
"use-lifecycle-interface": true,
"use-pipe-transform-interface": true,
"object-literal-sort-keys": false
},
"rulesDirectory": ["codelyzer"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment