Skip to content

Commit 83835f3

Browse files
committed
chore: update eslint, prettier, composer
1 parent 0deba34 commit 83835f3

File tree

6 files changed

+165
-252
lines changed

6 files changed

+165
-252
lines changed

.eslintrc.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"prettier"
2828
],
2929
"rules": {
30+
"quote-props": "off",
3031
"@typescript-eslint/no-explicit-any": "warn",
3132
"@wordpress/no-unused-vars-before-return": "off",
3233
"semi": [
@@ -52,7 +53,7 @@
5253
"error",
5354
{
5455
"endOfLine": "auto",
55-
"useTabs": false,
56+
"useTabs": true,
5657
"tabWidth": 2,
5758
"prettier-multiline-arrays-set-threshold": 1
5859
}
@@ -69,10 +70,6 @@
6970
"error"
7071
],
7172
"camelcase": "off",
72-
"quote-props": [
73-
"error",
74-
"consistent"
75-
],
7673
"jsdoc/valid-types": "off",
7774
"@typescript-eslint/no-unused-vars": [
7875
"warn",

.prettierrc.json

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
{
2-
"arrowParens": "always",
3-
"bracketSpacing": true,
4-
"parenSpacing": true,
5-
"printWidth": 80,
6-
"semi": false,
7-
"singleQuote": true,
8-
"tabWidth": 2,
9-
"trailingComma": "all",
10-
"useTabs": false,
11-
"endOfLine": "auto",
12-
"multilineArraysWrapThreshold": 4,
13-
"plugins": [
14-
"eslint-plugin-prettier",
15-
"prettier-plugin-multiline-arrays"
16-
],
17-
"overrides": [
18-
{
19-
"files": ["*.json"],
20-
"options": {
21-
"singleQuote": false
22-
}
23-
},
24-
{
25-
"files": [
26-
"*.yaml",
27-
"*.yml"
28-
],
29-
"options": {
30-
"singleQuote": false,
31-
"tabWidth": 2,
32-
"useTabs": false
33-
}
34-
}
35-
]
2+
"arrowParens": "always",
3+
"bracketSpacing": true,
4+
"parenSpacing": true,
5+
"printWidth": 80,
6+
"semi": false,
7+
"singleQuote": true,
8+
"tabWidth": 2,
9+
"trailingComma": "all",
10+
"useTabs": true,
11+
"endOfLine": "auto",
12+
"multilineArraysWrapThreshold": 4,
13+
"plugins": [
14+
"eslint-plugin-prettier",
15+
"prettier-plugin-multiline-arrays"
16+
],
17+
"overrides": [
18+
{
19+
"files": ["*.json"],
20+
"options": {
21+
"singleQuote": false
22+
}
23+
},
24+
{
25+
"files": [
26+
"*.yaml",
27+
"*.yml"
28+
],
29+
"options": {
30+
"singleQuote": false,
31+
"tabWidth": 2,
32+
"useTabs": false
33+
}
34+
}
35+
]
3636
}

composer.json

Lines changed: 40 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,42 @@
11
{
2-
"name": "j7-dev/wp-react-plugin",
3-
"description": "This is a boilerplate for creating a WordPress plugin with React, Tailwind, Ant Design, TypeScript, Zod, MSW, React Router v6, React Query v4, SCSS and Vite.",
4-
"type": "wordpress-plugin",
5-
"license": "GPL-2.0-only",
6-
"authors": [
7-
{
8-
"name": "JerryLiu",
9-
"email": "j7.dev.gg@gmail.com",
10-
"homepage": "https://github.com/j7-dev",
11-
"role": "Developer"
12-
}
13-
],
14-
"repositories": [
15-
{
16-
"type": "composer",
17-
"url": "https://wpackagist.org"
18-
}
19-
],
20-
"config": {
21-
"allow-plugins": {
22-
"dealerdirect/phpcodesniffer-composer-installer": true
23-
}
24-
},
25-
"require": {
26-
"kucrut/vite-for-wp": "^0.8.0",
27-
"j7-dev/wp-utils": "0.0.14"
28-
},
29-
"require-dev": {
30-
"squizlabs/php_codesniffer": "@stable",
31-
"wp-coding-standards/wpcs": "@stable",
32-
"dealerdirect/phpcodesniffer-composer-installer": "@stable"
33-
},
34-
"scripts": {
35-
"lint": "phpcs"
36-
}
2+
"name": "j7-dev/wp-react-plugin",
3+
"description": "This is a boilerplate for creating a WordPress plugin with React, Tailwind, Ant Design, TypeScript, Zod, MSW, React Router v6, React Query v4, SCSS and Vite.",
4+
"type": "wordpress-plugin",
5+
"license": "GPL-2.0-only",
6+
"authors": [
7+
{
8+
"name": "JerryLiu",
9+
"email": "j7.dev.gg@gmail.com",
10+
"homepage": "https://github.com/j7-dev",
11+
"role": "Developer"
12+
}
13+
],
14+
"repositories": [
15+
{
16+
"type": "composer",
17+
"url": "https://wpackagist.org"
18+
}
19+
],
20+
"config": {
21+
"allow-plugins": {
22+
"dealerdirect/phpcodesniffer-composer-installer": true
23+
}
24+
},
25+
"require": {
26+
"kucrut/vite-for-wp": "^0.8.0",
27+
"j7-dev/wp-utils": "0.0.14"
28+
},
29+
"require-dev": {
30+
"squizlabs/php_codesniffer": "@stable",
31+
"wp-coding-standards/wpcs": "@stable",
32+
"dealerdirect/phpcodesniffer-composer-installer": "@stable",
33+
"phpcompatibility/php-compatibility": "@stable",
34+
"phpstan/phpstan": "^1.11",
35+
"php-stubs/woocommerce-stubs": "^9.0",
36+
"php-stubs/wordpress-stubs": "^6.5",
37+
"phpstan/extension-installer": "^1.4"
38+
},
39+
"scripts": {
40+
"lint": "phpcs"
41+
}
3742
}

package.json

Lines changed: 76 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,78 @@
11
{
2-
"name": "create-wp-react-plugin",
3-
"version": "4.0.1",
4-
"type": "module",
5-
"scripts": {
6-
"bootstrap": "yarn install && composer install --no-interaction",
7-
"dev": "vite",
8-
"prebuild": "echo 'todo: remove console'",
9-
"build": "vite build && node release/mv-manifest.cjs",
10-
"preview": "vite preview",
11-
"format": "prettier-eslint --write \"js/src/**/*.tsx\"",
12-
"lint": "yarn eslint ./js/src/*.{ts,tsx} --ext .ts,.tsx && phpcbf",
13-
"lint:fix": "yarn eslint ./js/src/*.{ts,tsx} --fix && phpcbf",
14-
"release": "env-cmd -f ./.env release-it patch --ci --verbose --config ./release/.release-it.cjs",
15-
"release:build-only": "env-cmd -f ./.env release-it patch --ci --verbose --config ./release/.release-it.cjs --build-only",
16-
"release:patch": "env-cmd -f ./.env release-it patch --ci --verbose --config ./release/.release-it.cjs",
17-
"release:minor": "env-cmd -f ./.env release-it minor --ci --verbose --config ./release/.release-it.cjs",
18-
"release:major": "env-cmd -f ./.env release-it major --ci --verbose --config ./release/.release-it.cjs",
19-
"zip": "env-cmd -f ./.env node ./release/zip.cjs",
20-
"create:release": "env-cmd -f ./.env node ./release/create-release.cjs",
21-
"sync:version": "wp-update-project-version -s package.json -p plugin.php",
22-
"replace-string": "node ./replace-string.cjs"
23-
},
24-
"pre-commit": [
25-
"lint:fix"
26-
],
27-
"dependencies": {
28-
"@tanstack/react-query": "4.36.1",
29-
"axios": "^1.6.8",
30-
"react": "^18.2.0",
31-
"react-dom": "^18.2.0"
32-
},
33-
"devDependencies": {
34-
"@ant-design/cssinjs": "^1.19.1",
35-
"@kucrut/vite-for-wp": "^0.8.0",
36-
"@rollup/plugin-alias": "^5.1.0",
37-
"@soderlind/wp-project-version-sync": "^2.0.2",
38-
"@tanstack/react-query-devtools": "^5.28.10",
39-
"@types/lodash-es": "^4.17.12",
40-
"@types/node": "^20.12.2",
41-
"@types/react": "^18.2.73",
42-
"@types/react-dom": "^18.2.23",
43-
"@typescript-eslint/eslint-plugin": "^7.4.0",
44-
"@typescript-eslint/parser": "^7.4.0",
45-
"@vitejs/plugin-react": "^4.2.1",
46-
"@wordpress/eslint-plugin": "^17.11.0",
47-
"adm-zip": "^0.5.12",
48-
"archiver": "^7.0.1",
49-
"autoprefixer": "^10.4.19",
50-
"change-case-all": "^2.1.0",
51-
"env-cmd": "^10.1.0",
52-
"eslint": "^8.57.0",
53-
"eslint-config-airbnb": "^19.0.4",
54-
"eslint-config-prettier": "^9.1.0",
55-
"eslint-config-standard-with-typescript": "^43.0.1",
56-
"eslint-plugin-import": "^2.29.1",
57-
"eslint-plugin-n": "^16.6.2",
58-
"eslint-plugin-prettier": "^5.1.3",
59-
"eslint-plugin-promise": "^6.1.1",
60-
"eslint-plugin-react": "^7.34.1",
61-
"postcss": "^8.4.38",
62-
"postcss-import": "^16.1.0",
63-
"postcss-nesting": "^12.1.0",
64-
"pre-commit": "^1.2.2",
65-
"prettier": "^3.2.5",
66-
"prettier-eslint": "^16.3.0",
67-
"prettier-eslint-cli": "^8.0.1",
68-
"prettier-plugin-multiline-arrays": "^3.0.4",
69-
"release-it": "^17.1.1",
70-
"replace-in-file": "^7.1.0",
71-
"sass": "^1.72.0",
72-
"tailwindcss": "^3.4.3",
73-
"typescript": "^5.4.3",
74-
"typescript-eslint": "^7.4.0",
75-
"vite": "^5.2.7",
76-
"vite-plugin-live-reload": "^3.0.3",
77-
"vite-tsconfig-paths": "^4.3.2",
78-
"yargs": "^17.7.2",
79-
"yarn-upgrade-all": "^0.7.2"
80-
},
81-
"bin": "./bin/create.cjs"
2+
"name": "create-wp-react-plugin",
3+
"version": "4.0.1",
4+
"type": "module",
5+
"scripts": {
6+
"bootstrap": "yarn install && composer install --no-interaction",
7+
"dev": "vite",
8+
"prebuild": "echo 'todo: remove console'",
9+
"build": "vite build && node release/mv-manifest.cjs",
10+
"preview": "vite preview",
11+
"format": "prettier-eslint --write \"js/src/**/*.tsx\"",
12+
"lint": "npx eslint \"js/src/**/*.{ts,tsx}\" --ext .ts,.tsx --rule \"no-unused-vars: off\" && phpcbf",
13+
"lint:fix": "npx eslint \"js/src/**/*.{ts,tsx}\" --fix --rule \"no-unused-vars: off\" && phpcbf",
14+
"release": "env-cmd -f ./.env release-it patch --ci --verbose --config ./release/.release-it.cjs",
15+
"release:build-only": "env-cmd -f ./.env release-it patch --ci --verbose --config ./release/.release-it.cjs --build-only",
16+
"release:patch": "env-cmd -f ./.env release-it patch --ci --verbose --config ./release/.release-it.cjs",
17+
"release:minor": "env-cmd -f ./.env release-it minor --ci --verbose --config ./release/.release-it.cjs",
18+
"release:major": "env-cmd -f ./.env release-it major --ci --verbose --config ./release/.release-it.cjs",
19+
"zip": "env-cmd -f ./.env node ./release/zip.cjs",
20+
"create:release": "env-cmd -f ./.env node ./release/create-release.cjs",
21+
"sync:version": "wp-update-project-version -s package.json -p plugin.php",
22+
"replace-string": "node ./replace-string.cjs"
23+
},
24+
"dependencies": {
25+
"@tanstack/react-query": "4.36.1",
26+
"axios": "^1.6.8",
27+
"react": "^18.2.0",
28+
"react-dom": "^18.2.0"
29+
},
30+
"devDependencies": {
31+
"@ant-design/cssinjs": "^1.19.1",
32+
"@kucrut/vite-for-wp": "^0.8.0",
33+
"@rollup/plugin-alias": "^5.1.0",
34+
"@soderlind/wp-project-version-sync": "^2.0.2",
35+
"@tanstack/react-query-devtools": "^5.28.10",
36+
"@types/lodash-es": "^4.17.12",
37+
"@types/node": "^20.12.2",
38+
"@types/react": "^18.2.73",
39+
"@types/react-dom": "^18.2.23",
40+
"@typescript-eslint/eslint-plugin": "^7.4.0",
41+
"@typescript-eslint/parser": "^7.4.0",
42+
"@vitejs/plugin-react": "^4.2.1",
43+
"@wordpress/eslint-plugin": "^17.11.0",
44+
"adm-zip": "^0.5.12",
45+
"archiver": "^7.0.1",
46+
"autoprefixer": "^10.4.19",
47+
"change-case-all": "^2.1.0",
48+
"env-cmd": "^10.1.0",
49+
"eslint": "^8.57.0",
50+
"eslint-config-airbnb": "^19.0.4",
51+
"eslint-config-prettier": "^9.1.0",
52+
"eslint-config-standard-with-typescript": "^43.0.1",
53+
"eslint-plugin-import": "^2.29.1",
54+
"eslint-plugin-n": "^16.6.2",
55+
"eslint-plugin-prettier": "^5.1.3",
56+
"eslint-plugin-promise": "^6.1.1",
57+
"eslint-plugin-react": "^7.34.1",
58+
"postcss": "^8.4.38",
59+
"postcss-import": "^16.1.0",
60+
"postcss-nesting": "^12.1.0",
61+
"prettier": "^3.2.5",
62+
"prettier-eslint": "^16.3.0",
63+
"prettier-eslint-cli": "^8.0.1",
64+
"prettier-plugin-multiline-arrays": "^3.0.4",
65+
"release-it": "^17.1.1",
66+
"replace-in-file": "^7.1.0",
67+
"sass": "^1.72.0",
68+
"tailwindcss": "^3.4.3",
69+
"typescript": "^5.4.3",
70+
"typescript-eslint": "^7.4.0",
71+
"vite": "^5.2.7",
72+
"vite-plugin-live-reload": "^3.0.3",
73+
"vite-tsconfig-paths": "^4.3.2",
74+
"yargs": "^17.7.2",
75+
"yarn-upgrade-all": "^0.7.2"
76+
},
77+
"bin": "./bin/create.cjs"
8278
}

tailwind.config.cjs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ module.exports = {
77
},
88
content: ['./js/src/**/*.{js,ts,jsx,tsx}', './inc/**/*.php'],
99
theme: {
10+
animation: {
11+
// why need this? because elementor plugin might conflict with same animate keyframe name
12+
// we override the animation name with this
13+
pulse: 'tw-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite',
14+
},
1015
extend: {
1116
colors: {
1217
primary: '#1677ff',
@@ -18,6 +23,11 @@ module.exports = {
1823
xl: '1280px', // mac air
1924
xxl: '1440px',
2025
},
26+
keyframes: {
27+
'tw-pulse': {
28+
'50%': { opacity: '0.5' },
29+
},
30+
},
2131
},
2232
},
2333
plugins: [
@@ -31,10 +41,10 @@ module.exports = {
3141
'.tw-hidden': {
3242
display: 'none',
3343
},
34-
'.tw-column-1': {
44+
'.tw-columns-1': {
3545
columnCount: 1,
3646
},
37-
'.tw-column-2': {
47+
'.tw-columns-2': {
3848
columnCount: 2,
3949
},
4050
'.tw-fixed': {

0 commit comments

Comments
 (0)