Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update eslint configuration #1129

Merged
merged 81 commits into from
Apr 18, 2023
Merged
Changes from 1 commit
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
73efdc8
Snip internal deps for easier dep management.
wjhsf Mar 29, 2023
9df2da2
Temporarily disable build script.
wjhsf Mar 29, 2023
b0e912d
Use pwa-kit-dev for linting instead of internal-lib-build.
wjhsf Mar 29, 2023
b7757b4
Update eslint config to support modern TypeScript.
wjhsf Mar 29, 2023
705fb4f
Add eslint-plugin-react-hooks.
wjhsf Mar 30, 2023
297f21e
Move eslint-plugin-header to monorepo root.
wjhsf Mar 30, 2023
e2d195c
Remove unused eslint-disable directives.
wjhsf Mar 30, 2023
0a21099
Convert files to modules.
wjhsf Mar 30, 2023
62fae6a
Replace react-hooks/exhaustive-deps with use-effect-no-deps
wjhsf Mar 30, 2023
5e8d095
Linter fixes in commerce-sdk-react.
wjhsf Mar 30, 2023
d36ceb9
Disable rules about the `any` type.
wjhsf Mar 30, 2023
f99d934
Revert "Convert files to modules."
wjhsf Mar 30, 2023
4d41b35
Ignore no-var-requires.
wjhsf Mar 30, 2023
b6f5799
Remove unused disable directives.
wjhsf Mar 30, 2023
46fc578
Ignore no-var-requires.
wjhsf Mar 30, 2023
c135c8e
Merge branch 'v3' into wjh/update-eslint
wjhsf Apr 4, 2023
d2af6b0
Add comment.
wjhsf Apr 4, 2023
2e9c7c8
Fix lint errors in commerce-sdk-react.
wjhsf Apr 4, 2023
fa2351a
Use pwa-kit-dev to lint pwa-kit-dev.
wjhsf Apr 4, 2023
069c0f7
Fix lint errors in pwa-kit-dev.
wjhsf Apr 4, 2023
29ff436
Fix lint errors in pwa-kit-react-sdk.
wjhsf Apr 4, 2023
b0db361
Fix lint errors in pwa-kit-runtime.
wjhsf Apr 4, 2023
cd43682
Fix lint errors in template-express-minimal.
wjhsf Apr 4, 2023
4e9aac8
Fix lint errors in template-mrt-reference-app.
wjhsf Apr 4, 2023
b5dc106
Fix lint errors in template-retail-react-app.
wjhsf Apr 4, 2023
4ff954d
Fix lint errors in template-typescript-minimal.
wjhsf Apr 4, 2023
0998e87
Add TypeScript dep to TypeScript template.
wjhsf Apr 4, 2023
1148379
Add typecheck npm script.
wjhsf Apr 4, 2023
37c38e0
Fix type errors.
wjhsf Apr 4, 2023
0e5b55d
Fix type errors.
wjhsf Apr 4, 2023
b269bfa
Add typecheck script.
wjhsf Apr 4, 2023
55259d0
Add typecheck script.
wjhsf Apr 4, 2023
98b1942
Fix some lint errors in test-commerce-sdk-react.
wjhsf Apr 4, 2023
433a633
Fix script name.
wjhsf Apr 4, 2023
6ca19d3
Add typescript.
wjhsf Apr 4, 2023
ce7e756
Fix lint errors.
wjhsf Apr 4, 2023
9591294
Fix linter and type errors.
wjhsf Apr 4, 2023
5a474a8
Ignore dist.
wjhsf Apr 4, 2023
a48bfec
Sort package.json files.
wjhsf Apr 7, 2023
ef23fb6
Merge branch 'v3' into wjh/update-eslint
wjhsf Apr 7, 2023
8601410
Create eslintrc for pwa-kit-dev.
wjhsf Apr 7, 2023
4ea696f
Merge branch 'v3' into wjh/update-eslint
wjhsf Apr 11, 2023
ba4b3a5
Merge branch 'v3' into wjh/update-eslint
wjhsf Apr 12, 2023
1444b7b
Fix import to be relative to file, not cwd.
wjhsf Apr 13, 2023
d5b6419
Fix broken jest environment.
wjhsf Apr 13, 2023
bf251a3
Revert import to require to fix tests.
wjhsf Apr 13, 2023
3c87b6f
Change internal-lib-build to use pwa-kit-dev as source of truth for l…
wjhsf Apr 13, 2023
fb4351b
Revert import to require.
wjhsf Apr 13, 2023
b8ca0ab
Remove unneeded eslint directives.
wjhsf Apr 13, 2023
2410cc5
Remove non-null assertions.
wjhsf Apr 13, 2023
99911d8
Add eslint-plugin-jest.
wjhsf Apr 13, 2023
42e63a2
Linter fixes for eslint-plugin-jest.
wjhsf Apr 13, 2023
d4e865a
Fix broken tests.
wjhsf Apr 13, 2023
0a33a8d
Enforce jest style rules.
wjhsf Apr 13, 2023
658765d
Fix jest style.
wjhsf Apr 13, 2023
d82e18a
Move internal-lib-build's .eslintrc to correct location.
wjhsf Apr 13, 2023
84ed5cd
Merge branch 'v3' into wjh/update-eslint
wjhsf Apr 14, 2023
8b14bc0
Temporarily mark @loadable/component as an optional peer dependency.
wjhsf Apr 14, 2023
780f9e0
Wait for inner promise to resolve before resolving outer promise.
wjhsf Apr 14, 2023
dc6447c
Allow empty arrow functions.
wjhsf Apr 14, 2023
0aa891f
Properly fix no-empty-function lint errors.
wjhsf Apr 14, 2023
a5db9a2
Declare global instead of disabling rule.
wjhsf Apr 14, 2023
a9abd4c
Fix issue instead of disabling rule.
wjhsf Apr 14, 2023
498631e
Remove unused dependencies.
wjhsf Apr 14, 2023
548e3ab
Apply new lint rules to root scripts.
wjhsf Apr 14, 2023
8c919c5
Use template-retail-react-app as source of truth, rather than interna…
wjhsf Apr 14, 2023
7133d01
Remove unnecessary newlines.
wjhsf Apr 14, 2023
f9ba676
More small lint fixes.
wjhsf Apr 14, 2023
f71d011
Fix type errors.
wjhsf Apr 14, 2023
491a4ce
Update lockfiles.
wjhsf Apr 14, 2023
8c1c02f
A space.
wjhsf Apr 14, 2023
bbee379
Add new endpoints with TODO.
wjhsf Apr 14, 2023
1d14606
Revert "Update lockfiles."
wjhsf Apr 14, 2023
e189229
Revert "Add new endpoints with TODO."
wjhsf Apr 14, 2023
80e3824
Rename file.
wjhsf Apr 17, 2023
b170bda
Split config into partials to facilitate creating alternate configura…
wjhsf Apr 17, 2023
6c0f21a
Add lint config that doesn't use React.
wjhsf Apr 17, 2023
657d491
Add "safe types" eslint config.
wjhsf Apr 17, 2023
20d8388
Update eslint configs to point to new files.
wjhsf Apr 17, 2023
df2661d
Remove hard-coded config.
wjhsf Apr 17, 2023
139e663
Add README for lint configs.
wjhsf Apr 17, 2023
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
Prev Previous commit
Next Next commit
More small lint fixes.
wjhsf committed Apr 14, 2023

Verified

This commit was signed with the committer’s verified signature.
wjhsf Will Harney
commit f9ba67673d9658e19a6588f4f1bb04aabc05d8d4
2 changes: 0 additions & 2 deletions packages/pwa-kit-react-sdk/scripts/setup-jsdom.js
Original file line number Diff line number Diff line change
@@ -13,9 +13,7 @@ global.window.matchMedia =
function () {
return {
matches: false,

addListener: () => {},

removeListener: () => {}
}
}
Original file line number Diff line number Diff line change
@@ -48,7 +48,6 @@ class AppConfig extends React.Component {
* @return {Object} - the application state as an object, which will be
* serialized into JSON and embedded in the page HTML.
*/

// eslint-disable-next-line @typescript-eslint/no-unused-vars
static freeze(locals) {
return undefined
@@ -62,7 +61,6 @@ class AppConfig extends React.Component {
* the client.
* @return {Object}
*/

// eslint-disable-next-line @typescript-eslint/no-unused-vars
static extraGetPropsArgs(locals) {
return {}
Original file line number Diff line number Diff line change
@@ -167,7 +167,6 @@ export const RemoteServerFactory = {
/**
* @private
*/

// eslint-disable-next-line @typescript-eslint/no-unused-vars
_strictSSL(options) {
return true
@@ -176,7 +175,6 @@ export const RemoteServerFactory = {
/**
* @private
*/

// eslint-disable-next-line @typescript-eslint/no-unused-vars
_setCompression(app) {
// Let the CDN do it
@@ -231,7 +229,6 @@ export const RemoteServerFactory = {
/**
* @private
*/

// eslint-disable-next-line @typescript-eslint/no-unused-vars
_setupMetricsFlushing(app) {
// Hook for the dev-server
@@ -240,7 +237,6 @@ export const RemoteServerFactory = {
/**
* @private
*/

_updatePackageMobify(options) {
updatePackageMobify(options.mobify)
},
@@ -362,7 +358,6 @@ export const RemoteServerFactory = {
/**
* @private
*/

// eslint-disable-next-line @typescript-eslint/no-unused-vars
_addSDKInternalHandlers(app) {
// This method is used by the dev server, but is not needed here.
@@ -574,7 +569,6 @@ export const RemoteServerFactory = {
/**
* @private
*/

// eslint-disable-next-line @typescript-eslint/no-unused-vars
_setupProxying(app, options) {
app.all('/mobify/proxy/*', (_, res) => {
1 change: 0 additions & 1 deletion packages/pwa-kit-runtime/src/utils/ssr-cache.test.js
Original file line number Diff line number Diff line change
@@ -16,7 +16,6 @@ localRemoteTestCases.forEach((useLocalCache) => {
s3Endpoint: 'http://localhost:4568',
accessKeyId: 'S3RVER',
secretAccessKey: 'S3RVER',

sendMetric: () => {}
})
const key = 'key'
Original file line number Diff line number Diff line change
@@ -19,7 +19,6 @@ const FormActionButtons = ({
cancelButtonProps = {},
saveButtonLabel,
cancelButtonLabel,

onCancel = () => {}
}) => {
return (
Original file line number Diff line number Diff line change
@@ -49,7 +49,6 @@ const flags = {
* populated with all the supported locales for the application allowing the
* user to change the current locale.
*/

const LocaleSelector = ({selectedLocale = '', locales = [], onSelect = () => {}, ...props}) => {
const styles = useStyleConfig('LocaleSelector')
return (
Original file line number Diff line number Diff line change
@@ -23,7 +23,6 @@ describe('The OfflineBoundary', () => {
beforeEach(() => {
// React's logging is noisey even when an Error Boundary catches. Silence
// the distracting logs during tests, since they are expected in any event.

jest.spyOn(console, 'error').mockImplementation(() => {})
})

Original file line number Diff line number Diff line change
@@ -92,9 +92,7 @@ const ProductView = forwardRef(
addToWishlist,
updateWishlist,
isProductLoading,

isProductPartOfSet = false,

onVariantSelected = () => {},
validateOrderability = (variant, quantity, stockLevel) =>
!isProductLoading && variant?.orderable && quantity > 0 && quantity <= stockLevel
12 changes: 3 additions & 9 deletions packages/template-retail-react-app/app/utils/utils.js
Original file line number Diff line number Diff line change
@@ -76,7 +76,6 @@ export const shallowEquals = (a, b) => {
* around a function that will do nothing.
* Usually used as default for event handlers.
*/

export const noop = () => {}

/**
@@ -228,15 +227,10 @@ export const getConfigMatcher = (config) => {
})
const sites = [...siteIds, ...siteAliases].filter(Boolean)
const locales = [...localesIds, ...localeAliases].filter(Boolean)

// prettier-ignore

const searchPatternForSite = `site=(?<site>${sites.join('|')})`
// prettier-ignore
// eslint-disable-next-line
const pathPattern = `(?:\/(?<site>${sites.join('|')}))?(?:\/(?<locale>${locales.join("|")}))?(?!\\w)`
// prettier-ignore

const pathPattern = `(?:/(?<site>${sites.join('|')}))?(?:/(?<locale>${locales.join(
'|'
)}))?(?!\\w)`
const searchPatternForLocale = `locale=(?<locale>${locales.join('|')})`
const pathMatcher = new RegExp(pathPattern)
const searchMatcherForSite = new RegExp(searchPatternForSite)