All Projects → prettier → Tslint Plugin Prettier

prettier / Tslint Plugin Prettier

Licence: mit
Runs Prettier as a TSLint rule and reports differences as individual TSLint issues

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Tslint Plugin Prettier

spec
🐣 easy to use eslint/stylelint/tslint/prettier/...
Stars: ✭ 60 (-74.14%)
Mutual labels:  tslint, prettier
Prettier Tslint
Code ➡️ prettier ➡️ tslint --fix ➡️ Formatted Code ✨
Stars: ✭ 221 (-4.74%)
Mutual labels:  prettier, tslint
express-ts-api-boilerplate
Express TypeScript API Boilerplate
Stars: ✭ 15 (-93.53%)
Mutual labels:  tslint, prettier
Typescript Starter
Quickly create and configure a new library or Node.js project
Stars: ✭ 2,953 (+1172.84%)
Mutual labels:  prettier, tslint
alda
A boilerplate for React isomorphic aplication with Material Design
Stars: ✭ 16 (-93.1%)
Mutual labels:  tslint, prettier
web-build-tool-demo
比较全面的前端构建工具demo,拿来即练,不定时更新,包含git npm gulp webpack babel typescript husky eslint tslint lint-stage prettier等
Stars: ✭ 42 (-81.9%)
Mutual labels:  tslint, prettier
Aurora
📦 A set of configs and rules for Typescript projects.
Stars: ✭ 30 (-87.07%)
Mutual labels:  prettier, tslint
Prettier Plugin Tailwind
Sort tailwind classes in HTML with Prettier.
Stars: ✭ 192 (-17.24%)
Mutual labels:  prettier
Typescript
TypeScript coding guidelines & configs for Formik
Stars: ✭ 215 (-7.33%)
Mutual labels:  tslint
Init.nvim
An Opinionated Neovim Config for the Minimalists
Stars: ✭ 194 (-16.38%)
Mutual labels:  prettier
React Luo
React Automatically - 保持最新技术 react17 hooks router5 webpack5 babel7 antd4
Stars: ✭ 211 (-9.05%)
Mutual labels:  prettier
Stylelint Prettier
Stylelint plugin for Prettier formatting
Stars: ✭ 188 (-18.97%)
Mutual labels:  prettier
Prettier Plugin Sort Imports
A prettier plugin to sort imports in typescript and javascript files by the provided RegEx order.
Stars: ✭ 205 (-11.64%)
Mutual labels:  prettier
Prettier Ruby
Prettier for ruby
Stars: ✭ 196 (-15.52%)
Mutual labels:  prettier
Modern Node
All-in-one development toolkit for creating node modules with Jest, Prettier, ESLint, and Standard
Stars: ✭ 216 (-6.9%)
Mutual labels:  prettier
Mullet
Mullet Stack: Facebook in the front. Walmart in the back. (React, Hapijs, Node)
Stars: ✭ 194 (-16.38%)
Mutual labels:  prettier
Prettier Plugin Organize Imports
Make Prettier organize your imports using the TypeScript language service API.
Stars: ✭ 222 (-4.31%)
Mutual labels:  prettier
Tslint Language Service
TypeScript 2.2.1 plugin for tslint
Stars: ✭ 190 (-18.1%)
Mutual labels:  tslint
Codestyle
JavaScript and TypeScript Style Guide
Stars: ✭ 207 (-10.78%)
Mutual labels:  tslint
Codelyzer
Static analysis for Angular projects.
Stars: ✭ 2,436 (+950%)
Mutual labels:  tslint

tslint-plugin-prettier

npm build coverage

Runs Prettier as a TSLint rule and reports differences as individual TSLint issues.

Changelog

Sample

a();;;
    ~~
;;;
~~~ [Delete `;;⏎;;;`]
var foo = ''
          ~~ [Replace `''` with `"";⏎`]
var foo= "";
       ~ [Insert `·`]

Install

# using npm
npm install --save-dev tslint-plugin-prettier prettier

# using yarn
yarn add --dev tslint-plugin-prettier prettier

(require [email protected]^1.9.0)

Usage

(tslint.json)

for [email protected]^5.2.0

{
  "rulesDirectory": ["tslint-plugin-prettier"],
  "rules": {
    "prettier": true
  }
}

for [email protected]^5.0.0

{
  "extends": ["tslint-plugin-prettier"],
  "rules": {
    "prettier": true
  }
}

NOTE: To use this plugin, it'd better to also use tslint-config-prettier to disable all prettier-related rules, so as to avoid conflicts between existed rules.

Options

  • If there is no option provided, it'll try to load config file and/or .editorconfig if possible, uses Prettier's default option if not found.

    {
      "extends": ["tslint-plugin-prettier"],
      "rules": {
        "prettier": true
      }
    }
    

    If you don't want to load .editorconfig, disable it in the third argument.

    {
      "extends": ["tslint-plugin-prettier"],
      "rules": {
        "prettier": [true, null, { "editorconfig": false }]
      }
    }
    
  • If you'd like to specify which config file to use, just put its path (relative to process.cwd()) in the second argument, the following example shows how to load the config file from <cwd>/configs/.prettierrc:

    {
      "extends": ["tslint-plugin-prettier"],
      "rules": {
        "prettier": [true, "configs/.prettierrc"]
      }
    }
    
  • If you'd like to specify options manually, just put Prettier Options in the second argument, for example:

    {
      "extends": ["tslint-plugin-prettier"],
      "rules": {
        "prettier": [true, { "singleQuote": true }]
      }
    }
    

Ignoring files

  • It will respect your .prettierignore file in your project root ( process.cwd() ) but if you would like to use a different file you can provide it in the third argument, for example:

    {
      "extends": ["tslint-plugin-prettier"],
      "rules": {
        "prettier": [true, null, { "ignorePath": "otherDirectory/.prettierignore" }]
      }
    }
    
    

Development

# lint
yarn run lint

# build
yarn run build

# test
yarn run test

Related

License

MIT © Ika

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].