summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.js59
1 files changed, 11 insertions, 48 deletions
diff --git a/index.js b/index.js
index d9bff22..f80489c 100644
--- a/index.js
+++ b/index.js
@@ -44,51 +44,6 @@ const postCssConfig = {
]
};
-const esLintConfig = {
- 'root': true,
- 'extends': [
- 'eslint:recommended'
- ],
- 'globals': {
- 'wp': true,
- },
- 'env': {
- 'node': true,
- 'es6': true,
- 'amd': true,
- 'browser': true,
- 'jquery': true,
- },
- 'parser': '@babel/eslint-parser',
- 'parserOptions': {
- 'ecmaFeatures': {
- 'globalReturn': true,
- 'generators': false,
- 'objectLiteralDuplicateProperties': false,
- 'experimentalObjectRestSpread': true,
- },
- 'ecmaVersion': 2017,
- 'sourceType': 'module',
- 'requireConfigFile': false,
- },
- 'plugins': [
-
- ],
- 'settings': {
- 'import/core-modules': [],
- 'import/ignore': [
- 'node_modules',
- '\\.(coffee|scss|css|less|hbs|svg|json)$',
- ]
- },
- 'rules': {
- 'no-console': 0,
- 'quotes': ['error', 'single'],
- 'semi': ['warn', 'always'],
- 'comma-dangle': 0,
- },
-};
-
const styleLintConfig = {
'extends': 'stylelint-config-standard',
'plugins': ['stylelint-scss'],
@@ -99,6 +54,7 @@ const styleLintConfig = {
'selector-class-pattern': null, // TODO: remove and fix
'at-rule-no-unknown': null,
'function-no-unknown': null,
+ 'declaration-property-value-no-unknown': null,
'no-invalid-position-at-import-rule': [
true,
{
@@ -116,7 +72,12 @@ export const makeConfig = (env, argv, options) => {
const isProd = argv.mode === 'production',
isDev = argv.mode === 'development',
isWatch = typeof argv.watch !== 'undefined' && argv.watch === true,
- {paths, entry, plugins = [], manifestCustomize = (e) => e} = options;
+ {paths,
+ entry,
+ plugins = [],
+ manifestCustomize = (e) => e,
+ sassOptions = {}
+ } = options;
return {
entry,
@@ -162,7 +123,6 @@ export const makeConfig = (env, argv, options) => {
config: styleLintConfig,
}),
new EsLintPlugin({
- baseConfig: esLintConfig,
overrideConfig: {
rules: {
"no-console": isProd ? 2 : 1,
@@ -204,7 +164,10 @@ export const makeConfig = (env, argv, options) => {
postcssOptions: postCssConfig
}
},
- 'sass-loader',
+ {
+ loader: 'sass-loader',
+ options: sassOptions,
+ },
],
},
],