I understand this might not apply directly to Sage 9 but I was hoping someone could help me out. Lint configs are not my strongest suit.
I have my theme working with React and wanted to add the styled-components
package. When trying to use styled-components I get the following error:
Module build failed:
7 : return <Modal />
8 : }
9 : }
10 :
11 : const Modal = styled.div`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Tagged template strings are not supported. Use `transforms: { templateString: false }` to skip transformation and disable this error, or `transforms: { dangerousTaggedTemplateString: true }` if you know what you're doing (11:14)
You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.
Here are my config files:
.babelrc
{
"presets": ["react", "es2015"],
"plugins": ["babel-plugin-styled-components"]
}
.eslintrc.js
module.exports = {
root: true,
parser: "babel-eslint",
extends: ['plugin:react/recommended', 'prettier', 'prettier/react', 'airbnb'],
globals: {
wp: true,
it: false,
expect: false,
describe: false,
navigator: false,
},
env: {
node: true,
es6: true,
amd: true,
browser: true,
jquery: true,
},
parserOptions: {
ecmaFeatures: {
globalReturn: true,
generators: false,
objectLiteralDuplicateProperties: false,
experimentalObjectRestSpread: true,
},
ecmaVersion: 2017,
sourceType: 'module',
},
plugins: ['import', 'react', 'jsx-a11y'],
settings: {
'import/core-modules': [],
'import/ignore': [
'node_modules',
'\\.(coffee|scss|css|less|hbs|svg|json)$',
],
},
rules: {
'no-console': 0,
quotes: ['error', 'single'],
'comma-dangle': [
'error',
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'ignore',
},
],
semi: [2, 'never'],
'react/prop-types': [0],
'react/destructuring-assignment': [0],
'no-use-before-define': [0],
'import/prefer-default-export': [0],
'react/jsx-filename-extension': ['off'],
'linebreak-style': ['off'],
'no-undef': ['error'],
'react/sort-comp': ['off'],
'react/prefer-stateless-function': ['off'],
},
}
I do not have my own webpack config file.