1
0
Fork 0

chore: Fixed linter warnings

This commit is contained in:
Joost De Cock 2020-03-15 11:17:00 +01:00
parent 09951e70bb
commit 1a21e28deb
5 changed files with 4 additions and 16 deletions

View file

@ -34,10 +34,6 @@ const OptionPreamble = props => {
id: 'app.restorePatternDefaults', id: 'app.restorePatternDefaults',
defaultMessage: ' ♻️ ' defaultMessage: ' ♻️ '
}) })
const docsLabel = props.intl.formatMessage({
id: 'app.docs',
defaultMessage: ' 🤔 '
})
let pattern = false let pattern = false
if (props.dflt !== props.designDflt) pattern = true if (props.dflt !== props.designDflt) pattern = true
@ -109,7 +105,6 @@ OptionPreamble.propTypes = {
title: PropTypes.node.isRequired, title: PropTypes.node.isRequired,
desc: PropTypes.node.isRequired, desc: PropTypes.node.isRequired,
reset: PropTypes.func.isRequired, reset: PropTypes.func.isRequired,
showHelp: PropTypes.func.isRequired,
expanded: PropTypes.bool, expanded: PropTypes.bool,
displayFormat: PropTypes.string displayFormat: PropTypes.string
} }

View file

@ -116,9 +116,9 @@ export default {
sleevecapTopFactorX: { pct: 50, min: 25, max: 75 }, sleevecapTopFactorX: { pct: 50, min: 25, max: 75 },
sleevecapTopFactorY: { pct: 100, min: 35, max: 165 }, sleevecapTopFactorY: { pct: 100, min: 35, max: 165 },
sleevecapBackFactorX: { pct: 60, min: 35, max: 65 }, sleevecapBackFactorX: { pct: 60, min: 35, max: 65 },
sleevecapBackFactorY: { pct: 33, min: 35, max: 65 }, sleevecapBackFactorY: { pct: 33, min: 30, max: 65 },
sleevecapFrontFactorX: { pct: 55, min: 35, max: 65 }, sleevecapFrontFactorX: { pct: 55, min: 35, max: 65 },
sleevecapFrontFactorY: { pct: 33, min: 35, max: 65 }, sleevecapFrontFactorY: { pct: 33, min: 30, max: 65 },
sleevecapQ1Offset: { pct: 3, min: 0, max: 7 }, sleevecapQ1Offset: { pct: 3, min: 0, max: 7 },
sleevecapQ2Offset: { pct: 5.5, min: 0, max: 7 }, sleevecapQ2Offset: { pct: 5.5, min: 0, max: 7 },
sleevecapQ3Offset: { pct: 4.5, min: 0, max: 7 }, sleevecapQ3Offset: { pct: 4.5, min: 0, max: 7 },

View file

@ -486,7 +486,7 @@ function configurePatternUnitTests(pkg, config) {
fs.writeFileSync( fs.writeFileSync(
path.join(dest, file), path.join(dest, file),
Mustache.render( Mustache.render(
fs.readFileSync(path.join(source, file), "utf-8"), fs.readFileSync(path.join(source, file+'.template'), "utf-8"),
replace replace
) )
); );

View file

@ -68,7 +68,7 @@ const testPatternConfig = (design, pattern, expect, models, patterns) => {
} }
if (['rendertest', 'tutorial'].indexOf(design) !== -1) { if (['rendertest', 'tutorial'].indexOf(design) === -1) {
/* /*
* Ensure pattern is listed as being for breasts or not * Ensure pattern is listed as being for breasts or not
*/ */
@ -103,11 +103,9 @@ const testPatternConfig = (design, pattern, expect, models, patterns) => {
for (let name in pattern.config.options) { for (let name in pattern.config.options) {
let option = pattern.config.options[name] let option = pattern.config.options[name]
let type = typeof option let type = typeof option
let dflt
if (type === 'object' && typeof option.pct !== 'undefined') { if (type === 'object' && typeof option.pct !== 'undefined') {
// Percentage option // Percentage option
it(` - '${name}' is a percentage option`, () => true) it(` - '${name}' is a percentage option`, () => true)
dflt = option.pct
it(` - Should have a default value`, () => { it(` - Should have a default value`, () => {
expect(typeof option.pct).to.equal('number') expect(typeof option.pct).to.equal('number')
}) })
@ -121,7 +119,6 @@ const testPatternConfig = (design, pattern, expect, models, patterns) => {
else if (type === 'object' && typeof option.deg !== 'undefined') { else if (type === 'object' && typeof option.deg !== 'undefined') {
// Degree option // Degree option
it(` - '${name}' is a degree option`, () => true) it(` - '${name}' is a degree option`, () => true)
dflt = option.deg
it(` - Should have a default value`, () => { it(` - Should have a default value`, () => {
expect(typeof option.deg).to.equal('number') expect(typeof option.deg).to.equal('number')
}) })
@ -135,7 +132,6 @@ const testPatternConfig = (design, pattern, expect, models, patterns) => {
else if (type === 'object' && typeof option.mm !== 'undefined') { else if (type === 'object' && typeof option.mm !== 'undefined') {
// Millimeter option // Millimeter option
it(` - '${name}' is a distance (mm) option`, () => true) it(` - '${name}' is a distance (mm) option`, () => true)
dflt = option.mm
it(` - Should have a default value`, () => { it(` - Should have a default value`, () => {
expect(typeof option.mm).to.equal('number') expect(typeof option.mm).to.equal('number')
}) })
@ -149,7 +145,6 @@ const testPatternConfig = (design, pattern, expect, models, patterns) => {
else if (type === 'object' && typeof option.bool !== 'undefined') { else if (type === 'object' && typeof option.bool !== 'undefined') {
// Boolean option // Boolean option
it(` - '${name}' is a boolean option`, () => true) it(` - '${name}' is a boolean option`, () => true)
dflt = option.bool
it(` - Should have a default value`, () => { it(` - Should have a default value`, () => {
expect(typeof option.bool).to.equal('boolean') expect(typeof option.bool).to.equal('boolean')
}) })
@ -160,7 +155,6 @@ const testPatternConfig = (design, pattern, expect, models, patterns) => {
else if (type === 'object' && typeof option.count !== 'undefined') { else if (type === 'object' && typeof option.count !== 'undefined') {
// Count option // Count option
it(` - '${name}' is a count option`, () => true) it(` - '${name}' is a count option`, () => true)
dflt = option.count
it(` - Should have a default value`, () => { it(` - Should have a default value`, () => {
expect(typeof option.count).to.equal('number') expect(typeof option.count).to.equal('number')
}) })
@ -174,7 +168,6 @@ const testPatternConfig = (design, pattern, expect, models, patterns) => {
else if (type === 'object' && typeof option.list !== 'undefined') { else if (type === 'object' && typeof option.list !== 'undefined') {
// List option // List option
it(` - '${name}' is a list option`, () => true) it(` - '${name}' is a list option`, () => true)
dflt = option.dflt
it(` - Should have a default value`, () => { it(` - Should have a default value`, () => {
expect(typeof option.dflt).to.not.equal('undefined') expect(typeof option.dflt).to.not.equal('undefined')
}) })