这是indexloc提供的服务,不要输入任何密码
Skip to content

Add assets bundling with WPCS standards #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Apr 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extends @wordpress/browserslist-config
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**/*.min.js
**/node_modules/**
**/vendor/**
build/*
15 changes: 15 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"root": true,
"extends": [
"plugin:@wordpress/eslint-plugin/recommended-with-formatting",
"plugin:import/recommended",
"plugin:eslint-comments/recommended"
],
"env": {
"browser": true
},
"rules": {
"jsdoc/check-indentation": "error",
"@wordpress/dependency-group": "error"
}
}
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint:staged
11 changes: 11 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
"**/*.php": [
"npm run lint:php"
],
"**/*.js": [
"npm run lint:js"
],
"**/*.{css,scss}": [
"npm run lint:css"
],
};
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
save-exact = true
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16
3 changes: 3 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/assets/build/*.css
/tests
/vendor
7 changes: 7 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "@wordpress/stylelint-config/scss",
"ignoreFiles": [
"**/*.js"
],
"rules": {}
}
Empty file added assets/src/js/index.js
Empty file.
25 changes: 25 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* WordPress dependencies
*/
const defaultConfig = require( '@wordpress/babel-preset-default' );

module.exports = function( api ) {
const config = defaultConfig( api );

return {
...config,
plugins: [
...config.plugins,
// Add your own plugins here
],
sourceMaps: true,
env: {
production: {
plugins: [
...config.plugins,
// Add your own plugins here
],
},
},
};
};
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?php
// There is nothing output here because block themes do not use php templates.
// There is a core ticket discussing removing this requirement for block themes:
// https://core.trac.wordpress.org/ticket/54272.
/**
* There is nothing output here because block themes do not use php templates.
* There is a core ticket discussing removing this requirement for block themes:
* https://core.trac.wordpress.org/ticket/54272.
*
* @package Elementary
*/
Loading