Skip to content

Commit

Permalink
Add eslint and lint js files
Browse files Browse the repository at this point in the history
  • Loading branch information
wpalani committed Nov 26, 2023
1 parent eb23ad7 commit e7aeaef
Show file tree
Hide file tree
Showing 51 changed files with 1,969 additions and 2,026 deletions.
30 changes: 30 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module.exports = {
extends: [ 'plugin:@wordpress/eslint-plugin/recommended' ],
settings: {
'import/resolver': {
alias: {
map: [
[ 'App', './src/app' ],
[ 'Assets', './aseets' ],
],
extensions: [ '.js', '.jsx', '.json' ],
},
},
},
globals: {
__: true,
_camelCase: true,
_filter: true,
_n: true,
classNames: true,
useContext: true,
useEffect: true,
useState: true,
},
rules: {
'import/no-unresolved': [
'error',
{ ignore: [ '^App/', '^Assets/' ] },
],
},
};
111 changes: 65 additions & 46 deletions package-lock.json

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

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@wordpress/i18n": "^4.45.0",
"@wordpress/icons": "^9.36.0",
"classnames": "^2.3.2",
"eslint-import-resolver-alias": "^1.1.2",
"jquery": "^3.7.1",
"lodash": "^4.17.21",
"react": "^18.2.0",
Expand All @@ -47,9 +48,11 @@
"@tailwindcss/forms": "^0.5.6",
"@testing-library/cypress": "^10.0.1",
"@wordpress/env": "^8.11.0",
"@wordpress/eslint-plugin": "^17.3.0",
"@wordpress/scripts": "^26.16.0",
"cypress": "^13.4.0",
"cypress-axe": "^1.5.0",
"eslint-plugin-import": "^2.29.0",
"tailwindcss": "^3.3.5"
},
"scripts": {
Expand Down
14 changes: 7 additions & 7 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.exports = {
plugins: [
require("postcss-import"),
require("tailwindcss/nesting"),
require("tailwindcss"),
...require("@wordpress/postcss-plugins-preset"),
],
};
plugins: [
require( 'postcss-import' ),
require( 'tailwindcss/nesting' ),
require( 'tailwindcss' ),
...require( '@wordpress/postcss-plugins-preset' ),
],
};
46 changes: 24 additions & 22 deletions set-latest-wp-version.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
const fs = require('fs')
const fetch = require('node-fetch')
const wpEnv = require('./.wp-env.json')
const fs = require( 'fs' );
const fetch = require( 'node-fetch' );
const wpEnv = require( './.wp-env.json' );

fetch('https://api.wordpress.org/core/stable-check/1.0/')
.then(res => res.json())
.then(
json => {
const wpVersion = Object.keys(json)[Object.keys(json).length - 1]
wpEnv.core = `WordPress/WordPress#tags/${ wpVersion }`
fs.writeFile(
'./.wp-env.json',
JSON.stringify(wpEnv, null, 2),
'utf8',
(err) => {
if (err) {
console.log('An error occurred while writing latest WordPress version to .wp-env.json file.')
return console.log(err)
}
console.log(`The .wp-env.json file was updated with the latest WordPress version (${wpVersion}).`)
fetch( 'https://api.wordpress.org/core/stable-check/1.0/' )
.then( ( res ) => res.json() )
.then( ( json ) => {
const wpVersion = Object.keys( json )[ Object.keys( json ).length - 1 ];
wpEnv.core = `WordPress/WordPress#tags/${ wpVersion }`;
fs.writeFile(
'./.wp-env.json',
JSON.stringify( wpEnv, null, 2 ),
'utf8',
( err ) => {
if ( err ) {
console.log(
'An error occurred while writing latest WordPress version to .wp-env.json file.'
);
return console.log( err );
}
);
}
)
console.log(
`The .wp-env.json file was updated with the latest WordPress version (${ wpVersion }).`
);
}
);
} );
14 changes: 0 additions & 14 deletions src/app/components/accordion/index.js

This file was deleted.

Loading

0 comments on commit e7aeaef

Please sign in to comment.