- Identify the use cases that are in scope
- Determine constraints based on scoped use cases
use case
: the things your system needs to be do.
constraints
: the things your system will have to consider to be able to do stuff
{ | |
"rules": { // And why they're best practice (alphabetized). | |
"accessor-pairs": [2, {"getWithoutSet": true}], // omission is usually by mistake. | |
"array-bracket-spacing": 2, // spaces can make arrays take up a lot of space, and concise code allows for more reading context. | |
"array-callback-return": 2, // omission is usually by mistake. | |
"arrow-body-style": [2, "as-needed"], // improves consistency and readability. | |
// "arrow-parens": [2, "as-needed"], // allows for concise arrows while improving consistency. | |
"arrow-spacing": 2, // improves consistency and readability. | |
"block-scoped-var": 2, // can behave unexpectedly due to variable hoisting. | |
"block-spacing": 2, // helps differentiate blocks (spaced) from objects (not spaced). |
# Version key/value should be on his own line | |
PACKAGE_VERSION=$(cat package.json \ | |
| grep version \ | |
| head -1 \ | |
| awk -F: '{ print $2 }' \ | |
| sed 's/[",]//g') | |
echo $PACKAGE_VERSION |
{ | |
// http://eslint.org/docs/rules/ | |
"ecmaFeatures": { | |
"binaryLiterals": false, // enable binary literals | |
"blockBindings": false, // enable let and const (aka block bindings) | |
"defaultParams": false, // enable default function parameters | |
"forOf": false, // enable for-of loops | |
"generators": false, // enable generators | |
"objectLiteralComputedProperties": false, // enable computed object literal property names |
These steps show two less common interactions with git to extract a single file which is inside a subfolder from a git repository. These steps essentially reduce the repository to just the desired files and should performed on a copy of the original repository (1.).
First the repository is reduced to just the subfolder containing the files in question using git filter-branch --subdirectory-filter
(2.) which is a useful step by itself if just a subfolder needs to be extracted. This step moves the desired files to the top level of the repository.
Finally all remaining files are listed using git ls
, the files to keep are removed from that using grep -v
and the resulting list is passed to git rm
which is invoked by git filter-branch --index-filter
(3.). A bit convoluted but it does the trick.