Skip to content

Commit

Permalink
Add JS build process to plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Richards committed Sep 2, 2024
1 parent 6a70110 commit eb97860
Show file tree
Hide file tree
Showing 35 changed files with 31,508 additions and 37 deletions.
6 changes: 6 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": [
"@babel/preset-env",
["@babel/preset-react", { "runtime": "automatic" }]
]
}
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# WordPress Coding Standards
# https://make.wordpress.org/core/handbook/coding-standards/

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab

[*.yml]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/vendor/
/tools/wordpress
/tests/
/build/
25 changes: 25 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"extends": [
"plugin:@wordpress/eslint-plugin/recommended-with-formatting",
"plugin:react-hooks/recommended"
],
"env": {
"browser": true,
"es6": true
},
"rules": {
"@wordpress/no-global-event-listener": "off",
"jsdoc/check-indentation": "error",
"@wordpress/dependency-group": "error",
"@wordpress/react-no-unsafe-timeout": "error",
"react-hooks/exhaustive-deps": [ "error", { "additionalHooks": "useSelect" } ],
"import/order": [ "error", { "groups": [ "builtin", [ "external", "unknown" ], "internal", "parent", "sibling", "index" ] } ]
},
"parser": "@babel/eslint-parser",
"parserOptions": {
"requireConfigFile": false,
"babelOptions": {
"presets": [ "@babel/preset-react" ]
}
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.idea/
vendor/
tests/wordpress/
node_modules/
build/
.phpunit.result.cache
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.13
4 changes: 4 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const wp = require('@wordpress/prettier-config');
module.exports = {
...wp,
};
5 changes: 5 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/build/blocks/
/build/assets/
/tests/
/tools/
/vendor/
40 changes: 40 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"extends": "@wordpress/stylelint-config/scss",
"rules": {
"at-rule-no-unknown": null,
"scss/at-rule-no-unknown": true,
"font-weight-notation": null,
"function-url-quotes": null,
"max-line-length": null,
"no-descending-specificity": null,
"no-duplicate-selectors": null,
"scss/no-global-function-names": null,
"number-leading-zero": null,
"declaration-property-unit-allowed-list": {
"line-height": [
"px",
"rem",
"vw",
"vh"
]
},
"selector-type-no-unknown": [
true,
{
"ignore": [
"custom-elements"
]
}
],
"media-feature-name-no-unknown": [
true,
{
"ignoreMediaFeatureNames": [
"/query/",
"/prefers-reduced-motion/"
]
}
],
"selector-class-pattern": "^(?:(?:o|c|u|t|s|is|has|_|js|qa)-)?[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*(?:__[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)?(?:--[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)?(?:\\[.+\\])?$"
}
}
7 changes: 7 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"core": "./tools/wordpress",
"plugins": [
".",
"https://downloads.wordpress.org/plugin/query-monitor.3.9.0.zip"
]
}
Loading

0 comments on commit eb97860

Please sign in to comment.