Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

38 changes: 0 additions & 38 deletions .eslintrc.js

This file was deleted.

59 changes: 59 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
const AutomatticPlugin = require( '@automattic/eslint-plugin-wpvip' );
const ReactPlugin = require( 'eslint-plugin-react' );
const ReactHooksPlugin = require( 'eslint-plugin-react-hooks' );
const JsxA11yPlugin = require( 'eslint-plugin-jsx-a11y' );

module.exports = [
{
ignores: [
'node_modules/**/*',
'**/dist/**/*',
'vendor/**/*',
'**/*.build.js',
],
},
// Use individual configs instead of "recommended" to avoid react-hooks flat config bug
// in @automattic/eslint-plugin-wpvip@1.0.0 (uses legacy plugins array format)
...AutomatticPlugin.configs.javascript,
...AutomatticPlugin.configs.testing,
// Manually configure React with correct flat config exports
ReactPlugin.configs.flat.recommended,
ReactHooksPlugin.configs.flat.recommended,
JsxA11yPlugin.flatConfigs.recommended,
{
settings: {
react: {
version: 'detect',
},
},
rules: {
// Project-specific rule overrides (matching previous .eslintrc.js)
'no-prototype-builtins': 'off',
'no-eval': 'off',
complexity: 'off',
camelcase: 'off',
'no-undef': 'off',
'valid-jsdoc': 'off',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
'react-hooks/rules-of-hooks': 'off',
'no-redeclare': 'off',
'no-shadow': 'off',
'no-nested-ternary': 'off',
'no-var': 'off',
'no-unused-vars': 'off',
'no-useless-escape': 'off',
'prefer-const': 'off',
'no-global-assign': 'off',
'no-constant-binary-expression': 'off',
'valid-typeof': 'off',
eqeqeq: 'off',
radix: 'off',
'no-eq-null': 'off',
'array-callback-return': 'off',
'no-unused-expressions': 'off',
'no-alert': 'off',
'no-lonely-if': 'off',
},
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ const moveByWeeks = ( addOrSubtract, beginningOfWeek, pageUrl, filterValues, wee
queryArgFilters.start_date = beginningOfWeek;
}

queryArgFilters.start_date = moment( queryArgFilters.start_date, 'YYYY-MM-DD' )
[ addOrSubtract ]( weeksNumber, 'weeks' )
.format( 'YYYY-MM-DD' );
queryArgFilters.start_date = moment( queryArgFilters.start_date, 'YYYY-MM-DD' )[ addOrSubtract ]( weeksNumber, 'weeks' ).format( 'YYYY-MM-DD' );

return addQueryArgs( pageUrl, queryArgFilters );
};
Expand Down
6 changes: 3 additions & 3 deletions modules/calendar/lib/react/calendar.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import './style.react.scss';
function flatDeep( arr, d = 1 ) {
return d > 0
? arr.reduce(
( acc, val ) => acc.concat( Array.isArray( val ) ? flatDeep( val, d - 1 ) : val ),
[]
)
( acc, val ) => acc.concat( Array.isArray( val ) ? flatDeep( val, d - 1 ) : val ),
[]
)
: arr.slice();
}

Expand Down
4 changes: 2 additions & 2 deletions modules/calendar/lib/react/combobox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import './style.react.scss';
function getItems( filter, items ) {
return filter
? matchSorter( items, filter, {
keys: [ 'name' ],
} )
keys: [ 'name' ],
} )
: items;
}

Expand Down
Loading
Loading