Define technical problems in terms specific, personal, and emotional
Objectivity and absolutes don't exist in human systems
Use 3 month discussion freezes
Time-constrained voting
Enable dumb devs to write great code
Conventions should be easy to refactor/abandon
Create "utils" folders for
still-evolving problems
Code snippets
( )
.vscode/*.code-snippets
if (process.env.NODE_ENV !== 'production') {
// Check for insecure URL in href.
if (!this.allowInsecure && !/^(https|mailto|tel):/.test(this.href)) {
return console.error(
`Insecure <BaseLink href="${this.href}">. When linking to` +
`external sites, always prefer https URLs. If this site` +
`does not offer SSL, explicitly add the allow-insecure` +
`attribute to <BaseLink>.`
)
}
}
<ExternalLink href="http://example.com/" />
// Make console.error throw, so that Jest tests fail
const error = console.error
console.error = function(message) {
error.apply(console, arguments)
// NOTE: You can whitelist some `console.error` messages here
// by returning if the `message` value is acceptable.
throw message instanceof Error ? message : new Error(message)
}
Everyone knows when
tests are failing
Tests don't fail intermittently
Tests run quickly
When a test fails,
it's easy to learn why
/** @file lint-staged.config.js */
module.exports = {
'*.js': [
'eslint --fix',
'prettier --write',
'git add',
'jest --bail --findRelatedTests'
],
'*.scss': ['stylelint --fix', 'prettier --write', 'git add'],
'*.md': ['markdownlint', 'prettier --write', 'git add'],
'*.{png,jpeg,jpg,gif,svg}': ['imagemin-lint-staged', 'git add']
}
Everything from pre-commit
Essential end-to-end tests
Related end-to-end tests
Everything from pull/merge requests
All other end-to-end and unit tests
@chrisvfritz