{"_id":"@alixfachin/eslint-plugin-riotjs","_rev":"3-5618e0ce1249cfbae1e1112d1147fa29","name":"@alixfachin/eslint-plugin-riotjs","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.0":{"name":"@alixfachin/eslint-plugin-riotjs","version":"1.0.0","description":"plugin for eslint for .riot and .tag files (riot.js)","main":"src/index.js","scripts":{"test":"mocha","lint":"eslint src/*.js"},"keywords":["eslint","riot.js"],"author":{"name":"Alix Fachin"},"license":"MIT","dependencies":{"htmlparser2":"^7.2.0"},"devDependencies":{"chai":"^4.3.4","eslint":"^8.6.0","eslint-plugin-eslint-plugin":"^4.1.0","eslint-plugin-node":"^11.1.0","mocha":"^9.1.3"},"directories":{"test":"test"},"repository":{"type":"git","url":"git+https://github.com/AlixFachin/eslint-plugin-riotjs.git"},"bugs":{"url":"https://github.com/AlixFachin/eslint-plugin-riotjs/issues"},"homepage":"https://github.com/AlixFachin/eslint-plugin-riotjs#readme","gitHead":"65cea9b255e2d5d995db1e7cd2d03caee3137be9","_id":"@alixfachin/eslint-plugin-riotjs@1.0.0","_nodeVersion":"16.13.2","_npmVersion":"8.3.0","dist":{"integrity":"sha512-dFXhHPwVMxIeaLNUQUqC084q/ThDknn4sCoU+A/dF5ZbGb4kD8kom0ZveTvnBRXw0juqsTRUa0wCtyvU61NSdA==","shasum":"08093adb7cdaaeda24d8873e3e88aa9a756b9f3c","tarball":"https://registry.npmjs.org/@alixfachin/eslint-plugin-riotjs/-/eslint-plugin-riotjs-1.0.0.tgz","fileCount":5,"unpackedSize":7705,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh5MV0CRA9TVsSAnZWagAAcL4P/1RBNXKgdBYRrfmo0zip\nfqCFpVnMYJgxksKxHwi3sSiNQGnYYmqXw2mC7Z+9yfCX2p8IoFgpMZCnxG5U\n1W4ceicuYY0hH33FvGrwNqmgDqvmSnbmCOcfhqyKBsS+TF++fu25JNIhvfz3\nymoF+xpwAvL9GwZ19nbmRJukR0RIv034FJuJWi4XtOTGtK1y2sJCBTHeuMu+\nVQmWd1+7v2EZdYk5dwWIFdxtouVY0bUuy4RRI3m+kbapgCIy3GdP2IyleJmF\n+xPqcKkIQViKHhpP56ilTTIr7I0mMGtE7t/KQ+HY3v4o3hM3L0Jc+CGxHFXR\n/nOKhQYU3Py6t/b4gXoUNfC5g2lDGt6Cei4t+5z+NvsqCqnZFy9wXQu39xlk\neRP51NXMf5X+EwSuH0g4TjwKY4wVBarFwAzCENTvLNs3taw7MgU/OgjQIloP\nraBCH+moIKkDM77JU3/nQgdwkiSA0lbQQ/vyvPmZ857miQ3YQpP4MaCOiUBY\nT1ZyyXnnb6/+Slpy9xs7hI9IdxruBMNyFX4XSpoucl9NFlCD4FOAVahXOWnu\n7S5kXHZqrsTGvucwZa2zp1THQXgrjtXL1a0CNR8FXzRKr73K2cT3K9aieNPK\nxqfMu6bpx3aGMWEFdXS3USvd5soDG80/AZRxCOkhbGeRhx8udjb8N+wnYS80\nPYvQ\r\n=YrE0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDuOY0/JRMM9CVk5NBkp+W9lbwIcMnBNRuGAxdl+aBZTAIgezjDQa9UnsePD/z1FM+zTkm6EX+So0+cdRq5H00MNGM="}]},"_npmUser":{"name":"alixfachin","email":"alixfachin@gmail.com"},"maintainers":[{"name":"alixfachin","email":"alixfachin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-plugin-riotjs_1.0.0_1642382708828_0.24132833652046215"},"_hasShrinkwrap":false},"1.1.0":{"name":"@alixfachin/eslint-plugin-riotjs","version":"1.1.0","description":"plugin for eslint for .riot and .tag files (riot.js)","main":"src/index.js","scripts":{"test":"mocha","lint":"eslint src/*.js"},"keywords":["eslint","riot.js"],"author":{"name":"Alix Fachin"},"license":"MIT","dependencies":{"htmlparser2":"^7.2.0"},"devDependencies":{"chai":"^4.3.4","eslint":"^8.6.0","eslint-plugin-eslint-plugin":"^4.1.0","eslint-plugin-node":"^11.1.0","mocha":"^9.1.3"},"directories":{"test":"test"},"repository":{"type":"git","url":"git+https://github.com/AlixFachin/eslint-plugin-riotjs.git"},"bugs":{"url":"https://github.com/AlixFachin/eslint-plugin-riotjs/issues"},"homepage":"https://github.com/AlixFachin/eslint-plugin-riotjs#readme","gitHead":"de3594a238c6600c75b2c30feaa6a0f5b6956532","_id":"@alixfachin/eslint-plugin-riotjs@1.1.0","_nodeVersion":"16.13.2","_npmVersion":"8.3.0","dist":{"integrity":"sha512-iJTHFAJFR3xL7XkJqW2h3hwB2C9mPspBI42PT45l6vvjm08BAPkJbHK+K6Okh3ap6LjBAdxMohP9zIQ/UhaJAw==","shasum":"45530f9c2faa38c8c739f10cd742dcbe65cf1011","tarball":"https://registry.npmjs.org/@alixfachin/eslint-plugin-riotjs/-/eslint-plugin-riotjs-1.1.0.tgz","fileCount":6,"unpackedSize":14416,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/H5YCRA9TVsSAnZWagAAqNcP/17JimXzn3TjcD2evSx7\nKlxyI3O/KmTnqCA2T04IT06NvjMPmlo/bfdb3nrVeKhWeOTnofmoTcuXqySQ\ncESQlt9lfrszCgigEa65yZHVDRxMZgWY/vNYbM6ZXCYFZp78GABFTeb834LP\nzMtNtp6SaKpRnZIY5e6qI/lDQ4+ybBCGOexT6K2TQmJnsH4UYFVwod7kshrL\nx7heOTdxnzNaRlZoxk4wtPG93g4ku5v4UMk6inqX30MiVzc+VMIreEUIWS5q\nzudMr6JfGHRkpQKz/H8fw/FTeltsyQL4QBsOX4Bm1JhtyzXWFpOHJllTkAcz\nXqStLz8EWn+ovf9EjgxmY+FN80X0Nj6ABxqEEfCP4Qo0oPWjrtZ8FvTrnKDY\nJoJGFH1j5+66wyEEnTNUIBWl+nVoAc3/j2kHknv+8vekT33necCXVA+nFC3g\nWycCd377cuoHpoSuye0wOrDFSiyD1yU3msAb/sKDveIE2uQSNCngqcz01A5V\n+UWTvCvgOVLArWmKKVn4Ayrl6lZFJtSNnFUaC6sf1Emfia6J7GOvTpH0nimU\nDRm+il+vx/d/8bHHC2wApWwxqh6F0De1nTMvCfAokd4iScSZsS7VvmYL6xtN\nWFtWNHHq07Vm3hr4hQaIsXPc8Kzu1mPyCDE2sKekB6l+DcfWJ4RcTOg+RnRX\n0fUL\r\n=WjTL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA8q+N1raDE2dgmlksMjESr9ltDqrfZbU5vCSBUi0mm+AiBok/cNe7na26sboT8hjq5D8ZyAvTZTWqPYjd1qhr8W/A=="}]},"_npmUser":{"name":"alixfachin","email":"alixfachin@gmail.com"},"maintainers":[{"name":"alixfachin","email":"alixfachin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-plugin-riotjs_1.1.0_1643937367873_0.7390790446149085"},"_hasShrinkwrap":false},"1.2.0":{"name":"@alixfachin/eslint-plugin-riotjs","version":"1.2.0","description":"plugin for eslint for .riot and .tag files (riot.js)","main":"src/index.js","scripts":{"test":"mocha","lint":"eslint src/*.js"},"keywords":["eslint","riot.js"],"author":{"name":"Alix Fachin"},"license":"MIT","dependencies":{"htmlparser2":"^7.2.0"},"devDependencies":{"chai":"^4.3.4","eslint":"^8.6.0","eslint-plugin-eslint-plugin":"^4.1.0","eslint-plugin-node":"^11.1.0","mocha":"^9.1.3"},"directories":{"test":"test"},"repository":{"type":"git","url":"git+https://github.com/AlixFachin/eslint-plugin-riotjs.git"},"bugs":{"url":"https://github.com/AlixFachin/eslint-plugin-riotjs/issues"},"homepage":"https://github.com/AlixFachin/eslint-plugin-riotjs#readme","gitHead":"fc0de63ec3575eef3c239d58246b2b5f16b3d082","_id":"@alixfachin/eslint-plugin-riotjs@1.2.0","_nodeVersion":"16.13.2","_npmVersion":"8.3.0","dist":{"integrity":"sha512-nVsazgQR1oK9BwZEP/hdjfaNyepdZfbytc6lwtJN5H1D7csYQE7FUikwbOnGoS/Op8lw3LM8OxdkoDS1mp2tcQ==","shasum":"1bf6f45b2ad3d940113cf3598478dd8c57600613","tarball":"https://registry.npmjs.org/@alixfachin/eslint-plugin-riotjs/-/eslint-plugin-riotjs-1.2.0.tgz","fileCount":6,"unpackedSize":14241,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEzDagEc4Zi/FYNUl5LCNqPUrLYVgFkJzp3aeSyWMIF7AiEAir+Rq9/+RdZ1M/xuCRcuBH8sdn2Bclti/NaWbKG2e3c="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJigu56ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmraIhAAj8e4R/tjj9jysNbV7UGtZBx3JURF9YDYctH2ACUAItToEx1k\r\nxWRJnD9lZE6qhrnECvf+Ioecbvu7GIjy3KyMUKgNEdeyDFYE55DOBYDLRL1c\r\nQxjTC7yQJeWh4IRnAz7p+gIpddKXIf0znsNwc7PbdXRiJEEhF+QEFYOWW4w+\r\n89V1rU5WB037JG1yXfAi4tt1Q4X56owDALVURM1qff4saGVeFgBPd+Re1E8S\r\nX3d9QtVmwOC2zYCI06bRs8BGJqD+pLp3FZb6fDEov4Ud6AvdsqhGnoyIymW7\r\nRFeUAfc6lWAEmBXvQPRNf/W45FwaYzNPPrgo6gbV08wZ5eCSPl4UyXcT4P78\r\njwOcxY2KChGOrDpyM3WEYKXXuO+5yFK2YNiPfw/UoaTVbLa8pfqAZ0bzkBEa\r\nwmpln7sSvXKIfK/RRQVFk02bvC6AgN5vw033bXUL/vNrw0WYcotNCBmRqgSu\r\nMl42CTn6PAkW0KuRjntsWRMIBiQezjxFhNAscvvEPtu5CYe3Asxcavt0yOog\r\nt+kY8LxFlRSXLulLa7y30z2n+ADHsRii7QuxaakZxL99md/aXqa/POVDy0Gh\r\nP+I21BvY6sHn5myJtwDnuxxxvTxur7QX5sVNC7eTQsJD1u7Vm6a1MDo79Yge\r\nX+L7P3u7qYdcvN0o84qsgtReN+8BviQVyrU=\r\n=E6qz\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"alixfachin","email":"alixfachin@gmail.com"},"maintainers":[{"name":"alixfachin","email":"alixfachin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-plugin-riotjs_1.2.0_1652747898667_0.8786889796252639"},"_hasShrinkwrap":false}},"time":{"created":"2022-01-17T01:25:08.776Z","1.0.0":"2022-01-17T01:25:08.997Z","modified":"2022-05-17T00:38:18.976Z","1.1.0":"2022-02-04T01:16:08.032Z","1.2.0":"2022-05-17T00:38:18.882Z"},"maintainers":[{"name":"alixfachin","email":"alixfachin@gmail.com"}],"description":"plugin for eslint for .riot and .tag files (riot.js)","homepage":"https://github.com/AlixFachin/eslint-plugin-riotjs#readme","keywords":["eslint","riot.js"],"repository":{"type":"git","url":"git+https://github.com/AlixFachin/eslint-plugin-riotjs.git"},"author":{"name":"Alix Fachin"},"bugs":{"url":"https://github.com/AlixFachin/eslint-plugin-riotjs/issues"},"license":"MIT","readme":"# eslint-plugin-riotjs\n\n## Overview 🤓\n\nThis package contains a eslint plugin for riot.js files.\nThere are already pretty good plugins out there, but for work I needed\none plugin parsing the javascript outside of `<script>` `</script>` tags.\n(In riot.js anything after the `</style>` tag is considered as JavaScript)\n\n## Thanks to... 🎉\n\nSpecial thanks to:\n\n- Creators of [riot.js](https://riot.js.org)\n- [txchen](https://github.com/txchen) who made the original [eslint riot plugin](https://github.com/txchen/eslint-plugin-riot)\n\n## How does this work ( as a user) 🤔\n\n- You need to install _eslint_ first, for this see [Getting Started with eslint](https://eslint.org/docs/user-guide/getting-started)\n- Then you need to install this plugin: `npm install --save-dev @alixfachin/eslint-plugin-riotjs`\n- Then in your `.eslintrc` config (`.js` file, or `.json`, or `yaml`) add the plugin in the plugin section.\n  For example, with a `.eslintrc.js` file, you need to add:\n\n```\nmodule.exports = {\n    ...\n    // some stuff\n\n    // here is the part you need to add:\n     \"plugins\": [\n        \"eslint-plugin-riotjs\",\n    ],\n\n}\n```\n\n## How does this work (as a code) 👨‍💻\n\n### The general idea\n\n- The plugin contains a `processor`, which must have two methods:\n\n  - `preprocess`: which reads a source file and extracts the javascript which should be read, potentially in multiple blocks\n  - `postprocess`: which is given a list of errors found by `eslint` and which should correctly re-attribute them (right line number/column)\n    with the original file scope.\n\n- For the `preprocess`, we use a simple HTML parser, and according to tag openings/closing we extract corresponding JavaScript source to be linted.\n\n- The official documentation for es-lint plugins is at the following link:\n  <https://eslint.org/docs/developer-guide/working-with-plugins>\n\n### Some detailed explanations 👨🏻‍🏫\n\n- The `extract.js` script returns an array of \"codeBlock\" objects, which store the JS code (`codeBlock.source`) and other informations (start and end line, etc...)\n- The pre-processor will concatenate all the `source` properties, but keep the other information afterwards to reconstitute the proper original number\n\n- One issue was that we were using a lot of HTML strings into our JS code, which confuses the hell out of the HTML parser.\n\n```\n  const message = '<p>This is a paragraph</p>';\n```\n\nSo I had to add a routine during the pre-processor which adds the `<script> ... </script>` tags around the JS bit at the bottom.\n(And then remove the corresponding offset in line number to make as if the `<script>` was never added). 😓\n\n# How to Contribute 😎\n\nThis plugin is my first! So I guess there are tons of stuff wrongs with it and ways to make it better.\n(And some hacky stuff because I'd prefer taking a shortcut sometimes).\nI am not sure if I will have the time to take care of this - so if I don't reply too fast feel free to fork the project and tweak it to fit your own needs!\n","readmeFilename":"README.md"}