Giter Club home page Giter Club logo

agoda-tslint's Introduction

npm

agoda-tslint

A set of TSLint rules used on some Agoda projects.

do-not-use

Prints out a warning, that this function / method should not be used, and should get refactored if possible

A list of banned functions or methods in the following format:

  • marking functions as not cool:
    • just the name of the function: "functionName"
    • the name of the function in an array with one element: ["functionName"]
    • an object in the following format: {"name": "functionName", "message": "optional explanation message"}
  • marking methods as not cool:
    • an array with the object name, method name and optional message: ["functionName", "methodName", "optional message"]
    • an object in the following format: {"name": ["objectName", "methodName"], "message": "optional message"}
      • you can also ban deeply nested methods: {"name": ["foo", "bar", "baz"]} bans foo.bar.baz()
      • the first element can contain a wildcard (*) that matches everything. {"name": ["*", "forEach"]} bans [].forEach(...), $(...).forEach(...), arr.forEach(...), etc.

Example usage:

"do-not-use": [
    true,
    {name: ["*", "forEach"], message: "Please refactor and use regular loops instead"},
],

root-relative-imports

Prevents traversing upwards in directory structure when importing files, forcing the use of root relative imports instead.

Example:

import { MyComponent } from './MyComponent'; -> allowed
import { MyComponent } from './Child/MyComponent'; -> allowed
import { MyComponent } from 'components/MyComponent'; -> allowed
import { MyComponent } from '../components/MyComponent'; -> not allowed

Example usage:

"root-relative-imports": true,

agoda-tslint's People

Contributors

larsjarlvik avatar matmalkowski avatar tappasarn avatar

Watchers

 avatar  avatar

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.