.somethingrc
.babelignore .babelrc .editorconfig .eslintignore .eslintrc .flowconfig .gitattributes .gitignore .istanbul.yml .npmignore .nvmrc .prettierignore .prettierrc .proselintrc .remarkrc .shipit .stylelintrc .textlintrc .travis.yml appveyor.yml Changelog.md Code_of_Conduct.md codecov.yml Contributing.md Issue_Template.md jsconfig.json lerna.json License.md open-bot.yaml package.json Pull_Request_Template.md Readme.md tsconfig.json
npx mrm gitignore
npx mrm license
npx mrm jest
package.json
.gitignore
, .npmignore
, .eslintignore
CodeCov, EditorConfig, ESLint, Jest, lint-staged, Prettier, semantic-release, React Styleguidist, stylelint, Travis CI, TypeScript, package.json, contributing guidelines, license and readme files
Command line:
npx mrm license --config:licenseFile README
Config file:
~/.mrm/config.json
~/dotfiles/mrm/config.json
mrm-task-<TASK>
mrm-preset-<PRESET>
mrm-core
const { lines } = require('mrm-core');
module.exports = () => {
// Read .gitignore if it exists
lines('.gitignore')
// Add lines that do not exist in a file yet,
// but keep all existing lines
.add(['node_modules/', '.DS_Store'])
// Update or create a file
.save();
};
module.exports = config => {
// npm mrm eslint --config:eslintPreset airbnb
const { indent, eslintPreset } = config
.defaults({
// Default value
eslintPreset: 'eslint:recommended'
})
// Required option
.require('indent')
.values();
/* _ */
};
const { json } = require('mrm-core');
module.exports = config => {
// Read .eslintrc if it exists
json('.eslintrc')
// Merge content with new options
.merge({
parser: 'babel-eslint',
extends: 'eslint:recommended'
})
.save();
};
package.json
filesconst { packageJson } = require('mrm-core');
module.exports = config => {
// Read project’s package.json
packageJson()
// Add lint script
.setScript('lint', 'eslint . --cache --fix')
// Add pretest script
.prependScript('pretest', 'npm run lint')
.save();
};
const { packageJson, install } = require('mrm-core');
module.exports = config => {
const packages = ['eslint'];
const pkg = packageJson();
if (pkg.get('devDependencies.babel-core')) {
packages.push('babel-eslint');
}
// Install npm dependencies
install(packages);
};
Mrm: github.com/sapegin/mrm
Slides: bit.ly/mrm-slides
Me: sapegin.me
Twitter: @iamsapegin
GitHub: sapegin