forked from hello-pangea/dnd
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve esling config (hello-pangea#39)
* (tools) include more files in our eslint config and elint jest config to test folder * (fix) disabling some rule for a11y audit * Remove node version in eslint config
- Loading branch information
Showing
17 changed files
with
415 additions
and
342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module.exports = { | ||
rules: { | ||
'flowtype/require-valid-file-annotation': 'off', | ||
'no-console': "off", | ||
'no-console': 'off', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
const { plugins, presets } = require('@storybook/core/dist/server/common/babel'); | ||
const { | ||
plugins, | ||
presets, | ||
} = require('@storybook/core/dist/server/common/babel'); | ||
|
||
module.exports = { | ||
plugins, | ||
presets: [ | ||
...presets, | ||
'@emotion/babel-preset-css-prop', | ||
], | ||
comments: false | ||
} | ||
presets: [...presets, '@emotion/babel-preset-css-prop'], | ||
comments: false, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,19 @@ | ||
/* eslint-disable flowtype/require-valid-file-annotation */ | ||
/* eslint-disable import/no-unresolved */ | ||
/* eslint-disable global-require */ | ||
/* eslint-disable no-console */ | ||
try { | ||
// I disabled flow for this file because of this line. | ||
// Sometimes the file exists, sometimes it doesn't. | ||
// It depends on if you have run the accessibility test or not. | ||
// Given this conditional I thought it best to simply disable flow for the file | ||
const a11yReport = require('./test-reports/lighthouse/a11y.report.json'); | ||
const a11yScore = a11yReport.categories.accessibility.score; | ||
const a11yScoreFormatted = `${a11yScore ? a11yScore * 100 : 0}%`; | ||
// eslint-disable-next-line import/no-unresolved, node/no-missing-require | ||
const a11yReport = require('./test-reports/lighthouse/a11y.report.json'); | ||
|
||
const a11yScore = a11yReport.categories.accessibility.score; | ||
const a11yScoreFormatted = `${a11yScore ? a11yScore * 100 : 0}%`; | ||
|
||
console.log('*************************'); | ||
console.log('Lighthouse accessibility score: ', a11yScoreFormatted); | ||
console.log('*************************'); | ||
/* eslint-disable no-console */ | ||
console.log('*************************'); | ||
console.log('Lighthouse accessibility score: ', a11yScoreFormatted); | ||
console.log('*************************'); | ||
/* eslint-enable no-console */ | ||
|
||
if (a11yScore === 1) { | ||
// success! | ||
process.exit(0); | ||
} else { | ||
// fail build | ||
console.log( | ||
'\nNOTE: Lighthouse accessibility audit score must be 100% to pass this build step.\n\n', | ||
); | ||
process.exit(1); | ||
} | ||
} catch (e) { | ||
console.error(e); | ||
process.exit(1); | ||
if (a11yScore !== 1) { | ||
// fail build | ||
// eslint-disable-next-line no-restricted-syntax | ||
throw new Error( | ||
'NOTE: Lighthouse accessibility audit score must be 100% to pass this build step.', | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
// @flow | ||
const ports = { | ||
storybook: 9002, | ||
cspServer: 9003, | ||
|
Oops, something went wrong.