Meteor specific linting rules for ESLint
npm install eslint-plugin-meteorMeteor specific linting rules for ESLint
[![Build Status][actions-image]][actions-url]
[![Coverage Status][coverage-image]][coverage-url]
[![Dependency Status][deps-image]][deps-url]
[![Join the chat at https://gitter.im/dferber90/eslint-plugin-meteor][gitter-image]][gitter-url]
[![Maintenance Status][status-image]][status-url]
[![semantic-release][semantic-release-image]][semantic-release]
[![Commitizen friendly][commitizen-image]][commitizen]
[![License][license-image]][license-url]
[![NPM version][npm-image]][npm-url]
[![NPM downloads][npm-downloads-image]][npm-downloads-url]
This gif shows integration of ESLint-plugin-Meteor into Atom. Find out more in the integration guide.
Install ESLint and this plugin either locally or globally.
``sh`
$ npm install eslint --save-dev
$ npm install eslint-plugin-meteor --save-dev
Create an .eslintrc.json file with this content at the root of your project:
`json`
{
"plugins": ["meteor"],
"extends": ["plugin:meteor/recommended"]
}
For a more thorough introduction, read the setup guide.
An article with detailed setup instructions can be found here.
* General
* no-zero-timeout: Prevent usage of Meteor.setTimeout with zero delay
* Session
* no-session: Prevent usage of Session
* prefer-session-equals: Prefer Session.equals in conditions
* Security
* audit-argument-checks: Enforce check on all arguments passed to methods and publish functions
* Blaze
* template-names: Naming convention for templates
* no-template-lifecycle-assignments: Prevent deprecated template lifecycle callback assignments
* eventmap-params: Force consistent event handler parameter names in event maps
* prefix-eventmap-selectors: Convention for eventmap selectors
* scope-dom-lookups: Scope DOM lookups to the template instance
* no-dom-lookup-on-created: Forbid DOM lookups in template creation callback
* no-template-parent-data: Avoid accessing template parent data
This plugin exports a recommended configuration which enforces good Meteor practices.
The rules enabled in this configuration can be found in lib/index.js.
To enable the recommended configuration use the extends property in your .eslintrc.json config file:
`json`
{
"plugins": [
"meteor"
],
"extends": ["eslint:recommended", "plugin:meteor/recommended"]
}
You probably also want to enable ESLint to parse ECMAScript 2015 and to support React templates.
Add the following to your .eslintrc.json config file
`json``
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
}
}
See ESLint documentation for more information about extending configuration files.
ESLint-plugin-Meteor is not aware of where files are going to be executed, to keep the plugin simple.
It will not warn when accessing client-only features on the server and vice versa.
Read about set up of the development environment.
This plugin is inspired by eslint-plugin-react.
ESLint-plugin-Meteor is licensed under the MIT License.
[gitter-image]: https://img.shields.io/badge/gitter-chat-e10079.svg?style=flat-square
[gitter-url]: https://gitter.im/dferber90/eslint-plugin-meteor?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
[npm-url]: https://npmjs.org/package/eslint-plugin-meteor
[npm-image]: http://img.shields.io/npm/v/eslint-plugin-meteor.svg?style=flat-square
[npm-downloads-url]: https://npm-stat.com/charts.html?package=eslint-plugin-meteor
[npm-downloads-image]: https://img.shields.io/npm/dm/eslint-plugin-meteor.svg?style=flat-square
[actions-url]: https://github.com/dferber90/eslint-plugin-meteor/actions?query=workflow%3APR
[actions-image]: https://img.shields.io/github/workflow/status/dferber90/eslint-plugin-meteor/PR?style=flat-square
[deps-url]: https://david-dm.org/dferber90/eslint-plugin-meteor
[deps-image]: https://img.shields.io/david/dev/dferber90/eslint-plugin-meteor.svg?style=flat-square
[coverage-url]: https://coveralls.io/github/dferber90/eslint-plugin-meteor?branch=master
[coverage-image]: http://img.shields.io/coveralls/dferber90/eslint-plugin-meteor/master.svg?style=flat-square
[license-url]: https://github.com/dferber90/eslint-plugin-meteor/blob/master/LICENSE
[license-image]: https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square
[status-url]: https://github.com/dferber90/eslint-plugin-meteor/pulse
[status-image]: http://img.shields.io/badge/status-maintained-e10079.svg?style=flat-square
[semantic-release-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square
[semantic-release]: https://github.com/semantic-release/semantic-release
[commitizen-image]: https://img.shields.io/badge/commitizen-friendly-e10079.svg?style=flat-square
[commitizen]: http://commitizen.github.io/cz-cli/