Skip to content

Commit

Permalink
chore: switch asset compiling to Laravel Mix v6
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonTheAdams committed Mar 30, 2021
1 parent 3a97f3c commit 0b23411
Show file tree
Hide file tree
Showing 9 changed files with 32,798 additions and 15,795 deletions.
24 changes: 0 additions & 24 deletions .babelrc

This file was deleted.

13 changes: 13 additions & 0 deletions .babelrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"browsers": "last 2 version, > 0.05%, ie >= 10"
}
}
]
],
"plugins": ["@wordpress/babel-plugin-import-jsx-pragma", "@babel/plugin-transform-react-jsx", "@babel/plugin-proposal-class-properties"]
}
182 changes: 0 additions & 182 deletions .eslintrc

This file was deleted.

158 changes: 158 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
{
"root": true,
"parser": "@babel/eslint-parser",
"extends": ["plugin:@wordpress/eslint-plugin/esnext"],
"env": {
"browser": false,
"es6": true,
"node": true,
"mocha": true
},
"parserOptions": {
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"globals": {
"wp": true,
"wpApiSettings": true,
"window": true,
"document": true,
"giveApiSettings": true
},
"settings": {
"react": {
"pragma": "wp"
}
},
"rules": {
"linebreak-style": 0,
"array-bracket-spacing": ["error", "always"],
"brace-style": ["error", "1tbs"],
"camelcase": ["error", {"properties": "never"}],
"comma-dangle": ["error", "always-multiline"],
"comma-spacing": "error",
"comma-style": "error",
"computed-property-spacing": ["error", "always"],
"constructor-super": "error",
"dot-notation": "error",
"eol-last": "error",
"eqeqeq": "error",
"func-call-spacing": "error",
"indent": ["error", "tab", {"SwitchCase": 1}],
"jsx-quotes": "error",
"key-spacing": "error",
"keyword-spacing": "error",
"lines-around-comment": "off",
"no-alert": "error",
"no-bitwise": "error",
"no-caller": "error",
"no-console": "error",
"no-const-assign": "error",
"no-debugger": "error",
"no-dupe-args": "error",
"no-dupe-class-members": "error",
"no-dupe-keys": "error",
"no-duplicate-case": "error",
"no-duplicate-imports": "error",
"no-else-return": "error",
"no-eval": "error",
"no-extra-semi": "error",
"no-fallthrough": "error",
"no-lonely-if": "error",
"no-mixed-operators": "error",
"no-mixed-spaces-and-tabs": "error",
"no-multiple-empty-lines": ["error", {"max": 1}],
"no-multi-spaces": "error",
"no-multi-str": "off",
"no-negated-in-lhs": "error",
"no-nested-ternary": "error",
"no-redeclare": "error",
"no-restricted-syntax": [
"error",
{
"selector": "ImportDeclaration[source.value=/^@wordpress\\u002F.+\\u002F/]",
"message": "Path access on WordPress dependencies is not allowed."
},
{
"selector": "ImportDeclaration[source.value=/^blocks$/]",
"message": "Use @wordpress/blocks as import path instead."
},
{
"selector": "ImportDeclaration[source.value=/^components$/]",
"message": "Use @wordpress/components as import path instead."
},
{
"selector": "ImportDeclaration[source.value=/^date$/]",
"message": "Use @wordpress/date as import path instead."
},
{
"selector": "ImportDeclaration[source.value=/^editor$/]",
"message": "Use @wordpress/editor as import path instead."
},
{
"selector": "ImportDeclaration[source.value=/^element$/]",
"message": "Use @wordpress/element as import path instead."
},
{
"selector": "ImportDeclaration[source.value=/^i18n$/]",
"message": "Use @wordpress/i18n as import path instead."
},
{
"selector": "ImportDeclaration[source.value=/^data$/]",
"message": "Use @wordpress/data as import path instead."
},
{
"selector": "ImportDeclaration[source.value=/^utils$/]",
"message": "Use @wordpress/utils as import path instead."
},
{
"selector": "CallExpression[callee.name=/^__|_n|_x$/]:not([arguments.0.type=/^Literal|BinaryExpression$/])",
"message": "Translate function arguments must be string literals."
},
{
"selector": "CallExpression[callee.name=/^_n|_x$/]:not([arguments.1.type=/^Literal|BinaryExpression$/])",
"message": "Translate function arguments must be string literals."
},
{
"selector": "CallExpression[callee.name=_nx]:not([arguments.2.type=/^Literal|BinaryExpression$/])",
"message": "Translate function arguments must be string literals."
}
],
"no-shadow": "error",
"no-undef": "error",
"no-undef-init": "error",
"no-unreachable": "error",
"no-unsafe-negation": "error",
"no-unused-expressions": "error",
"no-unused-vars": "error",
"no-useless-computed-key": "error",
"no-useless-constructor": "error",
"no-useless-return": "error",
"no-var": "error",
"no-whitespace-before-property": "error",
"object-curly-spacing": ["error", "always"],
"padded-blocks": ["error", "never"],
"prefer-const": "error",
"quote-props": ["error", "as-needed"],
"semi": "error",
"semi-spacing": "error",
"space-before-blocks": ["error", "always"],
"space-before-function-paren": ["error", "never"],
"space-in-parens": ["error", "always"],
"space-infix-ops": ["error", {"int32Hint": false}],
"space-unary-ops": [
"error",
{
"overrides": {
"!": true
}
}
],
"template-curly-spacing": ["error", "always"],
"valid-jsdoc": ["error", {"requireReturn": false}],
"valid-typeof": "error",
"yoda": "off"
}
}
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Added CVD / CVV validation to the plugin which includes a new option. As well, we cleaned up the code a little bit. (#20)
- Added CVD / CVV validation to the plugin which includes a new option. As well, we cleaned up the code a little bit. (#20)

### Changed

- Switch to Laravel Mix v6 for compiling assets
Loading

0 comments on commit 0b23411

Please sign in to comment.