BenoitZugmeyer / eslint-plugin-html

An ESLint plugin to extract and lint scripts from HTML files.
ISC License
436 stars 51 forks source link

eslint don't work #119

Closed AnathanPham closed 5 years ago

AnathanPham commented 5 years ago

Description

I install eslint and eslint. package.json :

{
  "devDependencies": {
    "eslint": "^3.12.2",
    "eslint-config-airbnb": "^13.0.0",
    "eslint-plugin-html": "^5.0.5",
    "eslint-plugin-import": "^2.2.0",
    "eslint-plugin-jsx-a11y": "^2.2.3",
    "eslint-plugin-react": "^6.8.0"
 }
}

.eslintrc.json

{
  "env": {
    "browser": true,
    "commonjs": true,
    "es6": true,
    "node": true
  },
  "globals": {
    "React": "readonly"
  },
  "extends": ["eslint:recommended", "plugin:react/recommended"],
  "parserOptions": {
    "ecmaFeatures": {
      "jsx": true
    },
    "ecmaVersion": 2018,
    "sourceType": "module"
  },
  "parser": "babel-eslint",
  "plugins": ["react", "html"],
  "rules": {
    "indent": ["error", 2],
    "linebreak-style": ["error", "unix"],
    "quotes": ["error", "single"],
    "semi": ["error", "never"],
    "react/prop-types": 0,
    "react/react-in-jsx-scope": 0,
    "react/jsx-uses-react": "error",
    "react/jsx-uses-vars": "error",
    "no-use-before-define": 2
  }
}

then I run ./node_modules/.bin/eslint a.html ,bash throw a error

eslint-plugin-html error: It seems that eslint is not loaded.
If you think this is a bug, please file a report at https://github.com/BenoitZugmeyer/eslint-plugin-html/issues

In the report, please include *all* those informations:

* ESLint version: 3.19.0
* ESLint path: /Users/huang/work/distributor.hgobox.com/node_modules/eslint/lib/api.js
* Plugin version: 5.0.5
* Plugin inclusion paths: /Users/huang/work/distributor.hgobox.com/node_modules/eslint-plugin-html/src/index.js, /Users/huang/work/distributor.hgobox.com/node_modules/eslint/lib/config/plugins.js, /Users/huang/work/distributor.hgobox.com/node_modules/eslint/lib/config/config-file.js, /Users/huang/work/distributor.hgobox.com/node_modules/eslint/lib/config.js, /Users/huang/work/distributor.hgobox.com/node_modules/eslint/lib/cli-engine.js, /Users/huang/work/distributor.hgobox.com/node_modules/eslint/lib/cli.js, /Users/huang/work/distributor.hgobox.com/node_modules/eslint/bin/eslint.js
* NodeJS version: v11.13.0
* CLI arguments: ["/usr/local/Cellar/node/11.13.0/bin/node","/Users/huang/work/distributor.hgobox.com/node_modules/.bin/eslint","a.html"]
* Content of your lock file (package-lock.json or yarn.lock) or the output of `npm list`
* How did you run ESLint (via the command line? an editor plugin?)
* The following stack trace:
    at iterateESLintModules (/Users/huang/work/distributor.hgobox.com/node_modules/eslint-plugin-html/src/index.js:98:7)
    at Object.<anonymous> (/Users/huang/work/distributor.hgobox.com/node_modules/eslint-plugin-html/src/index.js:25:1)
    at Module._compile (internal/modules/cjs/loader.js:805:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:816:10)
    at Module.load (internal/modules/cjs/loader.js:672:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:612:12)
    at Function.Module._load (internal/modules/cjs/loader.js:604:3)
    at Module.require (internal/modules/cjs/loader.js:711:19)
    at require (internal/modules/cjs/helpers.js:14:16)
AnathanPham commented 5 years ago

When I changed the eslint version to 5.16.0, eslint-plugin-html worked again. It is known that eslint versions 3.12.2 and 6.0.1, eslint-plugin-html are invalid.

BenoitZugmeyer commented 5 years ago

I'm working on ESLint 6 support! should be ready soon.