forked from telepresenceio/telepresence.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
31 lines (27 loc) · 954 Bytes
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const fs = require('fs');
const graphql = require('graphql');
const gatsbyESLintConfig = require('gatsby/dist/utils/eslint-config');
const gatsbyWebpackUtils = require('gatsby/dist/utils/webpack-utils');
const graphQLSchema = (() => {
let str;
try {
str = fs.readFileSync('./schema.graphql').toString();
} catch (err) {
console.log("Warning: File ./schema.graphql does not exist;\n"+
" ESLint output regarding GraphQL queries may be inaccurate.\n"+
" Run a Gatsby command to generate the schema file.")
str = "type Query {\n\tempty(filter: Int!): Int\n}\n";
}
return graphql.buildSchema(str);
})();
const usingJSXRuntime = gatsbyWebpackUtils.reactHasJsxRuntime();
const baseConfig = gatsbyESLintConfig.eslintConfig(graphQLSchema, usingJSXRuntime).baseConfig;
module.exports = {
...baseConfig,
ignorePatterns: [
"/public/",
],
rules: {
...baseConfig.rules,
},
};