-
Notifications
You must be signed in to change notification settings - Fork 685
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
[PWA-1658] Move graphql-cli-validate-magento-pwa-queries to @magento scope #3198
Changes from 9 commits
fa7a5b0
f8a6f42
063b1bc
f005420
2b15e9a
99068e6
74243f0
4252a9a
5f025c7
b9de346
0f56922
52ed88d
f94d9dc
5b7fd9c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
const graphQLConfig = require('./graphql.config'); | ||
|
||
const config = { | ||
parser: 'babel-eslint', | ||
plugins: ['react'], | ||
extends: ['@magento'], | ||
rules: { | ||
'no-prototype-builtins': 'off', | ||
'no-undef': 'off', | ||
'no-useless-escape': 'off', | ||
'react/jsx-no-literals': [ | ||
|
@@ -15,7 +18,38 @@ const config = { | |
noStrings: true | ||
} | ||
] | ||
} | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['**/*.gql.js'], | ||
processor: '@graphql-eslint/graphql' | ||
}, | ||
{ | ||
files: ['*.graphql'], | ||
parser: '@graphql-eslint/eslint-plugin', | ||
parserOptions: { | ||
operations: graphQLConfig.documents, | ||
schema: graphQLConfig.schema, | ||
schemaOptions: { | ||
assumeValid: true, | ||
method: 'GET' | ||
}, | ||
skipGraphQLConfig: true | ||
}, | ||
plugins: ['@graphql-eslint'], | ||
rules: { | ||
'@graphql-eslint/known-directives': 'error', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've only added a small subset of rules here from |
||
'@graphql-eslint/naming-convention': [ | ||
'error', | ||
{ | ||
ObjectTypeDefinition: 'PascalCase', | ||
leadingUnderscore: 'allow' | ||
} | ||
], | ||
'@graphql-eslint/require-id-when-available': 'error' | ||
} | ||
} | ||
] | ||
}; | ||
|
||
module.exports = config; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const path = require('path'); | ||
require('dotenv').config({ | ||
path: path.resolve(process.cwd(), 'packages/venia-concept/.env') | ||
}); | ||
|
||
const excludePatterns = | ||
process.env.MAGENTO_BACKEND_EDITION === 'EE' | ||
? ['!**/*.ce.js'] | ||
: ['!**/*.ee.js']; | ||
|
||
const config = { | ||
schema: [ | ||
`${process.env.MAGENTO_BACKEND_URL}/graphql`, | ||
'**/client-schema.graphql' | ||
], | ||
documents: [ | ||
'./packages/{peregrine,venia-ui,venia-concept}/{lib,src}/**/*.{js,graphql,gql}', | ||
...excludePatterns | ||
], | ||
extensions: { | ||
codegen: { | ||
generates: { | ||
'./merged-schema.v4.json': { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New config structure for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed codegen section in 52ed88d |
||
plugins: ['introspection'] | ||
} | ||
} | ||
} | ||
} | ||
}; | ||
|
||
module.exports = config; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
extend type StoreConfig { | ||
payment_checkmo_payable_to: String | ||
payment_checkmo_mailing_address: String | ||
} |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have some files named
*.gql.ce.js
and.gql.ee.js
which I believe will get missed by this rule.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated pattern in b9de346