npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

eslint-config-amaze

0.1.1 • Public • Published

Deque ESLint

JavaScript, being a dynamic and loosely-typed language, is especially prone to developer error. Without the benefit of a compilation process, JavaScript code is typically executed in order to find syntax or other errors. Linting tools like ESLint allow developers to discover problems with their JavaScript code without executing it.

Why ESLint?

As stated earlier, linting allows developers to produce and commit clean, valid, and consistent code. By sharing our ruleset we can ensure our developers are coding to Deque’s best practices and formatting standards. Our standard rulesets (there are two of them) can be found on our private Bitbucket:

Each is suited for its respective environments. What works in React may not work in Node, as an example.

Using ESLint

If your project is under source control (such as Git) it may already include a copy of this ruleset. If not, require this file in your app with:

npm install --save-dev eslint-config-amaze

Get a linter

Once you have the ruleset locally or installed as a dependency, you’ll need the ESLinter. Depending on which editor you use determines how you install it.

Sublime Text

If you use Sublime do the following:

  • Open your Command Palette and type install
  • When the plugin list appears, type eslint
  • Viola!

Atom

Alternatively, if you use Atom, do the following:

  • Open your Settings/Preferences and navigate to Packages
  • Search for eslint and select the linter-eslint package
  • Viola!

Both of these plugins will check first in the project directory, but if no ESLint configuration file is found it will traverse into more global locations, starting with its install directory (if a dependency). This means that you could optionally save our standardized ESLint configuration ruleset somewhere globally and then point your plugins to its location. This would work for all of your projects without having to have it installed locally. However, any local rulesets will override any global rulesets, unless your editor allows either/or.

Required packages

If you’re using Node (i.e., have a package.json) file you may need to install a few additional packages:

  • eslint-config-standard
  • eslint-plugin-standard
  • eslint-plugin-promise
  • eslint-plugin-node
  • eslint-plugin-import

These should be included with this package.

Configuration file

Once you get the dependencies installed, if you're using this package by itself, you'll need to add the following file to the root of your repository:

{
  "extends": "eslint-config-amaze"
}

The filename needs to be .eslintrc.json.

Keywords

none

install

npm i eslint-config-amaze

Downloadsweekly downloads

2

version

0.1.1

license

MIT

repository

Gitbitbucket

last publish

collaborators

  • avatar
Report a vulnerability