Skip to content

txchen/eslint-plugin-riot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published