0.1.8 • Published 6 years ago

eslint-plugin-riot v0.1.8

Weekly downloads
745
License
MIT
Repository
github
Last release
6 years ago

eslint-plugin-riot

Build Status NPM version Code Climate

An ESLint plugin to extract and lint scripts from riot tag.

Supported extensions are .html and .tag.

It only lints es6, babel or javascript script in tag. It does not support riot mini es6 syntax.

Usage

Install the plugin:

npm install --save-dev eslint-plugin-riot

Add it to your .eslintrc:

{
  "plugins": ["riot"]
}

Write your riot tag file with extension .html or .tag, and wrap your script with <script type="es6"> </script>, for example:

<postcell>
  <div>
    <span>Id: {opts.data.postId}</span>
    <span>Title: <a href="#detail/{opts.data.postId}">{opts.data.title}</a></span>
    <span>{opts.data.likes} Likes</span>
    <button onclick={likePost}>Like</button>
  </div>

  <script type="es6">
  this.likePost = () => {
    riot.control.trigger(riot.VE.LIKE_POST, opts.data.postId)
  }
  </script>
</postcell>

Example

Here is an example of project that use riot + es6 + webpack + eslint + eslint-plugin-riot. It will show you how to use this plugin to configure your project.

0.1.8

6 years ago

0.1.7

7 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.3

8 years ago

0.0.2

9 years ago

0.0.1

9 years ago