├── LICENSE ├── README.md ├── index.js └── package.json /LICENSE: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2016 Sergey Rubanov 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # eslint-plugin-no-js 2 | 3 | This is an ESLint plugin to disable JavaScript. 4 | 5 | ## Installing 6 | 7 | `npm install eslint-plugin-no-js --save-dev` 8 | 9 | ## ESLint Rules 10 | 11 | ### no-js 12 | 13 | There's no reason to use JavaScript. 14 | 15 | ### no-jsx 16 | 17 | JSX is for PHP-lovers. We don't need that! 18 | 19 | ## Sample Configuration File 20 | 21 | Here's a sample ESLint configuration file that activates these rules: 22 | 23 | ``` 24 | { 25 | "plugins": [ 26 | "no-js" 27 | ], 28 | "rules": { 29 | "no-js/no-js": 2, 30 | "no-js/no-jsx": 2 31 | } 32 | } 33 | ``` 34 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var path = require('path'); 4 | 5 | module.exports = { 6 | rules: { 7 | 'no-js': function(context) { 8 | return { 9 | Program: function(node) { 10 | if (path.extname(context.getFilename()) === '.js') { 11 | context.report(node, 'You are attempting to use JavaScript. U MAD?'); 12 | } 13 | }, 14 | }; 15 | }, 16 | 'no-jsx': function(context) { 17 | return { 18 | Program: function(node) { 19 | if (path.extname(context.getFilename()) === '.jsx') { 20 | context.report(node, 'You are attempting to use JSX. This is strictly prohibited.'); 21 | } 22 | }, 23 | }; 24 | }, 25 | }, 26 | }; 27 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "eslint-plugin-no-js", 3 | "version": "0.2.0", 4 | "description": "ESLint plugin to disable JavaScript.", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/chicoxyzzy/eslint-plugin-no-js" 12 | }, 13 | "keywords": [ 14 | "eslint", 15 | "eslintplugin", 16 | "no-js", 17 | "no-jsx" 18 | ], 19 | "author": "Sergey Rubanov", 20 | "license": "WTFPL", 21 | "peerDependencies": { 22 | "eslint": ">=0.8.0" 23 | } 24 | } 25 | --------------------------------------------------------------------------------