Skip to content

Commit

Permalink
style: fix broken linting
Browse files Browse the repository at this point in the history
Disable the gatsby-config.js file from being linted was the only way to get it to work.
  • Loading branch information
ifiokjr committed Jan 12, 2020
1 parent ade2ed1 commit b9b559f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ examples/with-razzle/build/**
public
coverage
docs/generated/*
docs/.cache/
docs/gatsby-config.js
34 changes: 17 additions & 17 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
const { existsSync } = require('fs');

const { EXCLUDE_TS } = process.env;
const tsProjectOptions = EXCLUDE_TS ? {} : { project: ['./tsconfig.lint.json'] };
const tsProjectRules = EXCLUDE_TS
? {}
: {
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/prefer-readonly': 'warn',
'@typescript-eslint/await-thenable': 'warn',
'@typescript-eslint/no-unnecessary-type-assertion': 'warn',
'@typescript-eslint/no-unnecessary-type-arguments': 'warn',
'@typescript-eslint/restrict-plus-operands': 'warn',
'@typescript-eslint/no-misused-promises': 'warn',
// '@typescript-eslint/no-unnecessary-condition': ['warn', { ignoreRhs: true }], // TODO : test for false positives again
'@typescript-eslint/prefer-includes': 'warn',
'@typescript-eslint/prefer-string-starts-ends-with': 'warn',
};
const tsProjectOptions = { project: ['./tsconfig.lint.json'] };

const tsProjectRules = {
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/prefer-readonly': 'warn',
'@typescript-eslint/await-thenable': 'warn',
'@typescript-eslint/no-unnecessary-type-assertion': 'warn',
'@typescript-eslint/no-unnecessary-type-arguments': 'warn',
'@typescript-eslint/restrict-plus-operands': 'warn',
'@typescript-eslint/no-misused-promises': 'warn',
'@typescript-eslint/prefer-includes': 'warn',
'@typescript-eslint/prefer-string-starts-ends-with': 'warn',
// TODO : test for false positives again
// '@typescript-eslint/no-unnecessary-condition': ['warn', { ignoreRhs: true }],
};

const schemaJsonFilePath = `${__dirname}/docs/.cache/caches/gatsby-plugin-typegen/schema.json`;
const graphqlRules = existsSync(schemaJsonFilePath)
? {
Expand All @@ -37,12 +37,12 @@ module.exports = {
'plugin:@typescript-eslint/eslint-recommended', // Disables incompatible eslint:recommended settings
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
// 'plugin:jsx-a11y/recommended',
'plugin:react/recommended',
'plugin:import/typescript',
'prettier',
'prettier/@typescript-eslint',
'prettier/react',
// 'plugin:jsx-a11y/recommended',
],
plugins: [
'simple-import-sort',
Expand Down
2 changes: 1 addition & 1 deletion e2e/src/wysiwyg.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('Wysiwyg Showcase', () => {
await selectAll();
await page.keyboard.press('Delete');
await $editor.type(expected);
await expect($editor).toMatch(expected);
await expect($editor).resolves.toMatch(expected);
});

describe('codeBlock', () => {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.lint.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"allowJs": true
},
"include": ["**/*.ts", "**/*.tsx", "**/*.js", "*.js", ".eslintrc.js", "**/.babelrc.js"],
"exclude": ["**/dist", "**/lib/"]
"exclude": ["**/dist", "**/lib/", "**/public/", "**/.cache/", "docs/**/*.js"]
}

0 comments on commit b9b559f

Please sign in to comment.