Giter Site home page Giter Site logo

stencil-tslint's Introduction

This package is repackaged from stencil-tslint. Only intention to create this package is to be in sync with code organization pattern recommended by stenciljs.

stencil-tslint

Adds stylistic tslint rules for Stencil projects

Getting started

Add the following line to your tslint.json file to enable the default ruleset (which follows the Stencil Style Guide)

{
  "extends": ["stencil-tslint/default"]
}

Alternatively, you can extend the bare package and enable each rule on a individual basis

{
  "extends": ["stencil-tslint"],
  "rules": {
    "host-data-precedes-render": true
  }
}

Rules

Ensures that a Component's tag does not use any of the given prefixes.

Ensures that Component members are ordered consistently

Allows a maximum number of Components to be placed in a single file

Requires decorated class members to follow a consistent style (singleline or multiline)

Ensures that Component lifecycle methods are ordered consistently

Ensures that a Component's tag begins with the given prefix(es).

Contributing

Rules in the src/ directory must be camelCased and end in Rule. More information on developing custom tslint rules can be found on the tslint site

Before adding your custom rule, be sure to write a test for it. Then, you should be able to verify that it works by running:

npm run verify

stencil-tslint's People

Contributors

lalitkushwah avatar

Watchers

James Cloos avatar Rahul Rautwar avatar  avatar

stencil-tslint's Issues

banPrefixRule.js causes runtime error

Apparently TypeScript is not available though I am sure I have it installed.

Error: Cannot find module 'typescript'

Require stack:
- /Users/…/dev/node_modules/stencil-tslint/rules/banPrefixRule.js
- /Users/…/dev/…/node_modules/tslint/lib/ruleLoader.js
- /Users/…/dev/…/node_modules/tslint/lib/configuration.js
- /Users/…/dev/…/node_modules/tslint/lib/linter.js
- /Users/…/dev/…/node_modules/tslint/lib/tslintCli.js
- /Users/…/dev/…/node_modules/tslint/bin/tslint

Not sure what is going on.

One side note: I use my own tslint npm package where I include your's . It replaces https://github.com/natemoo-re/tslint-stencil

To test this, I've added you package in my package and npm linked it in the app where linting is applied.

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.