Eslint - enable react?

Hi

Trying to use the wp.hook.filter but getting this error:

Parsing error: Unexpected token >

I found that someone else had the same issue but the information in eslint’s website isn’t clear.

This is where I am at, I have followed the instructions in the link but still getting the error?

module.exports = {
    'root': true,
    'extends': 'eslint:recommended',
    'globals': {
        'wp': true,
    },
    'env': {
        'node': true,
        'es6': true,
        'amd': true,
        'browser': true,
        'jquery': true,
    },
    'parserOptions': {
        'ecmaFeatures': {
            "jsx": true,
            'globalReturn': true,
            'generators': false,
            'objectLiteralDuplicateProperties': false,
            'experimentalObjectRestSpread': true,
        },
        'ecmaVersion': 6,
        'sourceType': 'module',
    },
    'plugins': [
    'import',
    ],
    'settings': {
        'import/core-modules': [],
        'import/ignore': [
        'node_modules',
        '\\.(coffee|scss|css|less|hbs|icons|json)$',
        ],
    },
    'rules': {
        "semi": "error",
        'no-console': 0,
        'quotes': ['error', 'single'],
        "no-unused-vars": "off",
        'comma-dangle': [
        'error',
        {
            'arrays': 'always-multiline',
            'objects': 'always-multiline',
            'imports': 'always-multiline',
            'exports': 'always-multiline',
            'functions': 'ignore',
        },
        ],
    },
};

Maybe 'import/ignore': [ let the JSX parsing part ignore the files from node_modules,
hence the JavaScript parser still gets unprocessed JSX?

This topic was automatically closed after 42 days. New replies are no longer allowed.