Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Commit f0081e3

Browse files
Update the npm scripts to use wp-scripts for linting
1 parent d451ca5 commit f0081e3

File tree

11 files changed

+13360
-3597
lines changed

11 files changed

+13360
-3597
lines changed

.eslintrc.json

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
11
{
2-
"extends": [ "plugin:@wordpress/eslint-plugin/recommended" ]
2+
"root": true,
3+
"extends": [
4+
"plugin:@wordpress/eslint-plugin/recommended-with-formatting",
5+
"plugin:import/recommended",
6+
"plugin:eslint-comments/recommended"
7+
],
8+
"env": {
9+
"browser": true
10+
},
11+
"rules": {
12+
"jsdoc/check-indentation": "error",
13+
"@wordpress/dependency-group": "error"
14+
},
15+
"overrides": [{
16+
"files": [
17+
"**/__tests__/**/*.js",
18+
"**/test/*.js",
19+
"**/?(*.)test.js",
20+
"tests/js/**/*.js"
21+
],
22+
"extends": [
23+
"plugin:jest/all"
24+
],
25+
"rules": {
26+
// Add Rules for Jest here
27+
}
28+
}]
329
}

.lintstagedrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@ module.exports = {
88
"**/*.{css,scss}": [
99
"npm run lint:css"
1010
],
11+
"package.json": [
12+
"npm run lint:package-json"
13+
],
1114
};

.stylelintrc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2-
"extends": "@wordpress/stylelint-config/scss",
3-
"ignoreFiles": ["**/build/**"]
2+
"extends": "@wordpress/stylelint-config/scss",
3+
"ignoreFiles": [
4+
"**/*.js"
5+
],
6+
"rules": {}
47
}

assets/src/js/admin/customizer.js

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,40 @@
44
* Theme Customizer enhancements for a better user experience.
55
*
66
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
7+
* @param {Object} $ jQuery object.
78
*/
89

9-
(($) => {
10+
( ( $ ) => {
1011
// Site title and description.
11-
wp.customize('blogname', (value) => {
12-
value.bind(function (to) {
13-
$('.site-title a').text(to);
14-
});
15-
});
12+
wp.customize( 'blogname', ( value ) => {
13+
value.bind( function( to ) {
14+
$( '.site-title a' ).text( to );
15+
} );
16+
} );
1617

17-
wp.customize('blogdescription', (value) => {
18-
value.bind(function (to) {
19-
$('.site-description').text(to);
20-
});
21-
});
18+
wp.customize( 'blogdescription', ( value ) => {
19+
value.bind( function( to ) {
20+
$( '.site-description' ).text( to );
21+
} );
22+
} );
2223

2324
// Header text color.
24-
wp.customize('header_textcolor', (value) => {
25-
value.bind(function (to) {
26-
if ('blank' === to) {
27-
$('.site-title, .site-description').css({
25+
wp.customize( 'header_textcolor', ( value ) => {
26+
value.bind( function( to ) {
27+
if ( 'blank' === to ) {
28+
$( '.site-title, .site-description' ).css( {
2829
clip: 'rect(1px, 1px, 1px, 1px)',
2930
position: 'absolute',
30-
});
31+
} );
3132
} else {
32-
$('.site-title, .site-description').css({
33+
$( '.site-title, .site-description' ).css( {
3334
clip: 'auto',
3435
position: 'relative',
35-
});
36-
$('.site-title a, .site-description').css({
36+
} );
37+
$( '.site-title a, .site-description' ).css( {
3738
color: to,
38-
});
39+
} );
3940
}
40-
});
41-
});
42-
} )( jQuery ); // eslint-disable-line -- no-undef
41+
} );
42+
} );
43+
} )( jQuery ); // eslint-disable-line no-undef

assets/src/js/components/fonts.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ const WebFont = {
2626
loadWebFonts() {
2727
const WebFontConfig = {
2828
google: {
29-
families: ['Open Sans:300,400,700', 'Roboto:500'],
29+
families: [ 'Open Sans:300,400,700', 'Roboto:500' ],
3030
},
3131
};
3232

33-
WebFontLoader.load(WebFontConfig);
33+
WebFontLoader.load( WebFontConfig );
3434
},
3535
};
3636

assets/src/js/home.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22
* Home scripts.
33
*/
44

5+
/**
6+
* Internal dependencies
7+
*/
58
import '../sass/home.scss';

assets/src/js/main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
* Main scripts, loaded on all pages.
33
*/
44

5+
/**
6+
* Internal dependencies
7+
*/
58
import '../sass/main.scss';
69
import { common as BlankThemeCommons } from './components';
710

assets/src/js/single.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22
* Single page scripts.
33
*/
44

5+
/**
6+
* Internal dependencies
7+
*/
58
import '../sass/single.scss';

0 commit comments

Comments
 (0)