Skip to content

Commit

Permalink
js lint
Browse files Browse the repository at this point in the history
  • Loading branch information
bajoski34 committed May 12, 2023
1 parent 07b7da0 commit f64d5b9
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
!.eslintrc.js
build
assets
bin
docs
includes
i18n/languages
release
tasks
templates
vendor
tests
22 changes: 22 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
extends: [ ],
rules: {
// You can use the 'rules' key to override specific settings in the WooCommerce plugin
'@wordpress/i18n-translator-comments': 'warn',
'@wordpress/valid-sprintf': 'warn',
'jsdoc/check-tag-names': [
'error',
{ definedTags: [ 'jest-environment' ] },
],
},
settings: {
// List of modules that are externals in our webpack config.
// This helps the `import/no-extraneous-dependencies` and
//`import/no-unresolved` rules account for them.
'import/core-modules': [
'@wordpress/i18n',
'@wordpress/is-shallow-equal',
'@wordpress/element',
],
},
};
39 changes: 39 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Ignore all hidden files and directories
/.* export-ignore


# Ignore following directories and contents
/node_modules* export-ignore
/tests export-ignore
/bin export-ignore
/docs export-ignore

/composer.lock export-ignore
/composer.json export-ignore
/phpunit.xml.dist export-ignore
/phpunit.xml export-ignore
/phpcs.xml export-ignore
/phpcbf.xml export-ignore
/*.config.js export-ignore
/.eslintrc export-ignore
/.eslintrc.js export-ignore
/.eslintignore export-ignore
/.tx export-ignore
/.editorconfig export-ignore
/.jshintrc export-ignore
/.phpcs.xml export-ignore
/.travis.yml export-ignore
/.editorconfig export-ignore
/.prettierrc.js export-ignore
/.babelrc export-ignore
/webpack.config.js export-ignore
/playwrignt.config.js
docs export-ignore
assets/css/*.scss export-ignore
# Directories
/.wordpress-org export-ignore
/.github export-ignore

# Files
/.gitattributes export-ignore
/.gitignore export-ignore
1 change: 1 addition & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require( '@wordpress/prettier-config' );
2 changes: 1 addition & 1 deletion src/API/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function request(string $url, string $method = 'GET', array $data = []) {
$wp_args['timeout'] = $this->timeout;
$wp_args['body'] = \wp_json_encode( $data, JSON_UNESCAPED_SLASHES );
$wp_args['headers'] = $this->headers;
if( !empty($data) || $method === 'GET' ) {
if( empty($data) || $method === 'GET' ) {
unset($wp_args['body']);
}

Expand Down

0 comments on commit f64d5b9

Please sign in to comment.