1.0.2 • Published 7 years ago
eslint-plugin-strudel v1.0.2
eslint-plugin-strudel
Official ESLint plugin for Strudel.js
Requirements
- ESLint
^5.0.0 - Node.js
>=6.10.0
Installation
Install ESLint either locally or globally.
$ npm i eslint eslint-plugin-strudel -DUsage
Create .eslintrc.* file to configure rules. See: http://eslint.org/docs/user-guide/configuring
Example .eslintrc.js:
{
"extends": [
"plugin:strudel/recommended"
]
}Configs
This plugin provides two predefined configs:
plugin:strudel/base: Settings and rules to enable correct ESLint parsingplugin:strudel/recommended: Above, plus rules to prevent errors and ensure consistency
Rules
- strudel/element-import: enforce importing
elementas$ - strudel/single-line-el: enforce using
@Elwith it's property in one line - strudel/no-useless-init: prevent useless
initmethod - strudel/first-method-init: enforce
initbeing first method if used - strudel/oninit-on-top: enforces methods decorated with
@OnInitto be first methods of class - strudel/element-on-top: enforces properties decorated with
@Elto be on top of class body
Contribution
Before you start writing new rule, please read the official ESLint guide.
Next you need to get an idea how the AST looks like - use astexplorer.net to inspect ASTs.
When writing tests for rules Debugging Mocha guide for Visual Studio Code may become helpful.
License
Copyright (c) 2017-present, Mateusz Łuczak