0.1.6 • Published 8 years ago

@rensovargas/eslint-plugin-riot v0.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
8 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.

lints es6 and text/javascript script in tag.

Usage

Install the plugin:

npm install --save-dev @rensovargas/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>
0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago