相关文章推荐

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account archived due to age This issue has been archived; please open a new issue for any further discussion Relates to ESLint's core APIs and features
  • **ESLint Version: 6.8.0 --> through gulp-eslint(6.0.0)
  • **Node Version: 10.15.3
  • **npm Version: 6.4.1
  • **What parser (default, @babel/eslint-parser , @typescript-eslint/parser , etc.) are you using? default

    Please show your full configuration:

    Configuration
        //setting this config for both browser and node environment.
        "env": {
            "node": true,
            "es6": true
        //parsing options for the linter to understand the newer version of js and jsx.
        "parserOptions": {
            "ecmaVersion":2018,
            "ecmaFeatures": {
                "jsx": true
        //settings required for eslint-plugin-react
        "settings": {
            "react": {
              "createClass": "createClass",
              "pragma": "React",
              "version": "detect"
        //this config extends the eslint recommended and react presets.
        "extends":["eslint:recommended", "plugin:react/recommended"],
        //rules to be applied by eslint while validating the code.
        "rules": {
            "curly": "error", //enforce consistent brace style for all control statements
            "no-undef": "error", //disallow the use of undeclared variables unless mentioned in `/*global */` comments
            "no-unused-vars": "error",
            "no-trailing-spaces": "error",
            "semi": "error", //semicolons a must to end a statement
            "no-const-assign": "error",
            "eqeqeq": "error", //require the use of `===` and `!==`
            "no-extra-boolean-cast":"off"
            1. anything that is globally used in the code, should be added here.
            2. Format is "<Global var>":"<readonly/writable/off>"
        "globals": {
    

    What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

    function lintJs() {
        console.log('[LINTIFYING] Lintifying JS and JSX files');
        return src(['app.js','./src/**/*.js', './src/**/*.jsx','./lib/**/*.js'])
            .pipe(eslint())
            .pipe(eslint.formatEach())
            .pipe(eslint.failAfterError())
    
    gulp lintJs
    

    What did you expect to happen?
    I expect eslint to lint my js and jsx files successfully

    What actually happened? Please include the actual, raw output from ESLint.
    ...calculateStatsPerFile(messages)
    SyntaxError: Unexpected token ...
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)

    SyntaxError: Unexpected token ...
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)

    It looks like you're running ESLint in an environment that doesn't support object spread syntax (e.g., Node < 8.3.0). Can you double-check your Node version?

     
    推荐文章