You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: eslint-plugin-prettier.js
+46-15Lines changed: 46 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -179,22 +179,53 @@ module.exports = {
179
179
// * Prettier supports parsing the file type
180
180
// * There is an ESLint processor that extracts JavaScript snippets
181
181
// from the file type.
182
-
constparserBlocklist=[null,'markdown','html'];
183
-
184
-
letinferParserToBabel=
185
-
parserBlocklist.indexOf(inferredParser)!==-1;
186
-
187
-
if(
188
-
// it could be processed by `@graphql-eslint/eslint-plugin` or `eslint-plugin-graphql`
189
-
inferredParser==='graphql'&&
190
-
// for `eslint-plugin-graphql`, see https://github.com/apollographql/eslint-plugin-graphql/blob/master/src/index.js#L416
191
-
source.startsWith('ESLintPluginGraphQLFile`')
192
-
){
193
-
inferParserToBabel=true;
194
-
}
182
+
if(filepath===onDiskFilepath){
183
+
// The following list means the plugin process source into js content
184
+
// but with same filename, so we need to change the parser to `babel`
// it could be processed by `@graphql-eslint/eslint-plugin` or `eslint-plugin-graphql`
197
+
inferredParser==='graphql'&&
198
+
// for `eslint-plugin-graphql`, see https://github.com/apollographql/eslint-plugin-graphql/blob/master/src/index.js#L416
0 commit comments