Giter VIP home page Giter VIP logo

typescript-standard's Introduction

Zero-configuration TypeScript Standard Validator & Formatter

Validate and format your TypeScript using Visual Studio styles.

Installation

npm install typescript-standard --save-dev

Uninstall

npm uninstall typescript-standard --save-dev

Usage

package.json

{
  "scripts": {
    "test": "node_modules/.bin/standard"
  }
}

CLI at project root folder

./node_modules/.bin/standard
./node_modules/.bin/standard --pretty

or in your code

var engine = require('typescript-standard')
console.log(engine.lint());

Extras

typescript-standard-loader - Webpack@2+ loader

Tips

Here is a easier way to run local node_modules by adding the .bin folder into your $PATH variable

export PATH=$PATH:node_modules/.bin

Roadmap

  • TypeScript Code Standard Validation (TSLint)
  • 0.3.x TypeScript Code Pretty Printer (tsc)
  • 0.4.x TypeScript Code Import Formatter (ts-format-imports)
  • 0.5.x TypeScript Code Standard Autofix (Prettier)

Updates

0.3.36

  • Remove unused dependencies

0.3.32

0.3.30

0.3.2

  • Format ts files when you run standard --pretty

0.2.12

  • Bug fixing

0.2.6

  • 100% typescript!!!

0.2.5

  • Bug fixing

0.2.1

  • Add --pretty and --verbose output style from cli
  • Rewrite this project in typescript

0.2.0

  • Add support for Typescript 2 'include' field
  • Removed semicolon check because the program is not smart enough to handle all semicolon scenarios with uglifyjs

0.1.1

  • Imported official typescript standard rules from Microsoft repository.
  • The file and exclude from tsconfig.json is supported.

About

BTW, this is my first typescript project and the reason behind this project is because I know I am going to build elegance typescript frameworks. I need a tool to make it happen.

typescript-standard's People

Contributors

e2tox avatar termosa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

typescript-standard's Issues

do not minify build

typescript-standard is not intended tobe part of browser bundle. There is no good reason to uglify build.
It's not usual to make minification for node modules and it also affects error outputs.
Eg, I have now completely useless error like:

turn r.m=t,r.c=n,r.p="",r(0)}([function(t,r,n){"use strict";var i=n(1),e=n(13),o=n(11),a=n(10),u=o.argv.slice(2),s=u.filter(function(t){return!t.startsWith("-")}),c=u.in
cludes("--pretty"),f=u.includes("--verbose"),l=null;parseInt(o.version.match(/v(\d+)\./)[1],10)<4&&(console.error("standard: Node v4 or greater is required. `standard` d
id not run."),o.exit(1)),s.length&&(l=a.expend(s));var d=e.ValidatorOutputFormat.PROSE_OUTPUT;c?d=e.ValidatorOutputFormat.STYLISH_OUTPUT:f&&(d=e.ValidatorOutputFormat.VE
RBOSE_OUTPUT);var p=function(t){return t.failureCount>0&&console.log(t.output),!1};i.lint({format:d,files:l,callback:p})},function(t,r,n){"use strict";function i(t){void
 0===t&&(t={});var r=new o.ValidatorConfigParser,n=t.files&&t.files.length?t.files:r.files(),i=r.options(t.format||a.                                                    

TypeError: u.includes is not a function                                                                                                                                  
    at Object.t (d:\ws\testapp\node_modules\typescript-standard\bin\cli.js:2:337)                                                                                        
    at r (d:\ws\testapp\node_modules\typescript-standard\bin\cli.js:2:107)                                                                                               
    at d:\ws\testapp\node_modules\typescript-standard\bin\cli.js:2:194                                                                                                   
    at Object.<anonymous> (d:\ws\testapp\node_modules\typescript-standard\bin\cli.js:2:199)                                                                              
    at Module._compile (module.js:409:26)                                                                                                                                
    at Object.Module._extensions..js (module.js:416:10)                                                                                                                  
    at Module.load (module.js:343:32)                                                                                                                                    
    at Function.Module._load (module.js:300:12)                                                                                                                          
    at Function.Module.runMain (module.js:441:10)                                                                                                                        
    at startup (node.js:139:18)

Plan for next release

  1. Support TypeScript 4.5
  2. Add more custom eslint rules with auto fix
  3. Auto sort/reorder imports
  4. Support import alias

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.