Giter VIP home page Giter VIP logo

eslint-plugin-ember-extra-linting's Introduction

eslint-plugin-ember-extra-linting

Additional ember linting rules

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-ember-extra-linting:

$ npm install eslint-plugin-ember-extra-linting --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-ember-extra-linting globally.

Usage

Basic Usage

Add ember-extra-linting to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "ember-extra-linting"
    ]
}

You can the specify the rules you wish to implement. If you want to use the recommended rule set see below.

Configuration

Add the plugin's recommended configuration to the list of extensions:

// .eslintrc.js

module.exports = {
  // ...
  extends: [
    'eslint:recommended',
    'plugin:ember-extra-linting/recommended'
  ],
  rules: {
  }
};

Then configure the rules you want to use under the rules section.

{
    "rules": {
        "ember-extra-linting/rule-name": 2
    }
}

Supported Rules

ember-no-autogenerated-comments: Errors if any of the testing autogenerated comments are left in files. These should either be removed or replaced with specific comments. Note: this rule is only configured for ember 3.0+ currently.

ember-no-double-gets: Errors if trying to get from the same object twice in a single block. This informs the user that they should be using the getProperties method.

ember-no-double-sets: Errors if trying to get from the same object twice in a single block. This informs the user that they should be using the getProperties method.

ember-no-get-properties: Errors if using the getProperties function. Not recommended unless using Ember 3.1+.

ember-no-pointless-gets: Errors if trying to use the get function on the object without using the ability to check for properties. Informs the user that property access is not preferred (since 3.1);

ember-require-inject-as-service: Requires import { inject as service } from '@ember/service for consistency, does not allow plain inject.

ember-require-service-used: Errors if a service is injected and never used.

ember-no-pointless-service-arguments: Errors if a service name is specified when it is not required.

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.