Giter Site home page Giter Site logo

forcedotcom / eslint-plugin-aura Goto Github PK

View Code? Open in Web Editor NEW
27.0 11.0 9.0 533 KB

Salesforce Lightning (Aura) specific linting rules for ESLint

License: BSD 3-Clause "New" or "Revised" License

JavaScript 99.77% Shell 0.23%
eslint-plugin eslint eslintplugin salesforce salesforce-lightning aura aura-framework

eslint-plugin-aura's Introduction

eslint-plugin-aura

Build status NPM version

Salesforce Lightning (Aura) specific linting rules for ESLint.

Installation

npm install --save-dev @salesforce/eslint-plugin-aura

Usage

Add this plugin to your ESLint configuration and extend your desired configuration. See ESLint documentation for details.

Example:

{
  "plugins": ["@salesforce/eslint-plugin-aura"],
  "extends": [
    "plugin:@salesforce/eslint-plugin-aura/recommended",
    "plugin:@salesforce/eslint-plugin-aura/locker"
  ]
}

Rules

Aura

Rule ID Description
aura/aura-api validate Aura APIs
aura/getevt-markup-prefix verify the presence of the markup:// prefix for events accessed via $A.getEvt()
aura/no-deprecated-aura-error prevent usage of $A.error
aura/no-deprecated-component-creation prevent usage of deprecated component creation methods
aura/no-deprecated-event-creation prevent usage of deprecated event creation methods

Locker

Rule ID Description
aura/ecma-intrinsics validate JavaScript intrinsic APIs
aura/secure-document validate secure document public APIs
aura/secure-window validate secure window public APIs

Configurations

This package exposes 2 configurations for your usage.

@salesforce/eslint-plugin-aura/recommended configuration

Goal: Prevent common pitfalls with Lightning component development, and enforce other Salesforce platform restrictions.

Rules:

@salesforce/eslint-plugin-aura/locker configuration

Goal: Prevent Lightning Locker violations.

Rules:

  • @salesforce/eslint-plugin-aura/recommended rules.
  • Proper usage of document and window via the secure-document and secure-window rules, respectively.
  • Proper usage of Javascript intrinsic APIs via the ecma-intrinsics rule.

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.