UNPKG

@interaktiv/dia-scripts

Version:

CLI toolbox with common scripts for most sort of projects at DIA

37 lines (35 loc) 2.1 kB
"use strict"; const { ifBitbucketRepo, isOptedOut, resolveSelf, resolveBin } = require('../utils'); const diaScripts = resolveSelf(); const doctoc = resolveBin('doctoc'); const doctocMode = ifBitbucketRepo('--bitbucket', '--github'); const doctocLinter = `${doctoc} ${doctocMode} --maxlevel 3 --notitle`; module.exports = { '(README|MAINTAINING).md': [doctocLinter, 'git add'], 'other/{MAINTAINING,manual-releases}.md': [doctocLinter, 'git add'], // 'docs/*.md': [`${doctoc} ${doctocMode} --maxlevel 3 --notitle`, 'git add'], // TODO: Implement Bitbucket support for all-contributors first // '.all-contributorsrc': [ // `${diaScripts} contributors generate`, // 'git add README.md', // ], '*.{md,mdown,markdown}': [isOptedOut('autoformat', null, `${diaScripts} format`), `${diaScripts} lint markdown`, isOptedOut('autoformat', null, 'git add')], // TODO: mdx files need another markdownlint config, but currently I do not know which one // '*.+(mdx)': [ // isOptedOut('autoformat', null, `${diaScripts} format`), // `${diaScripts} lint markdown --config <TBD>`, // isOptedOut('autoformat', null, 'git add'), // ], '*.{js,jsx,vue,ts,tsx}': [isOptedOut('autoformat', null, `${diaScripts} format`), `${diaScripts} lint aura`, `${diaScripts} lint javascript`, // TODO: Should we run tests on pre-commit? Or via CI only? `${diaScripts} test javascript --findRelatedTests`, isOptedOut('autoformat', null, 'git add')].filter(Boolean), // Run apex linting separately cause we do not want to have the SFDX CLI running to often 'force-app/**/*.{cls,class,trg,trigger,apx,apex}': [isOptedOut('autoformat', null, `${diaScripts} format`), `${diaScripts} lint apex`, // TODO: Should we run tests on pre-commit? Or via CI only? // TODO: Find `--findRelatedTests` equivalent for Apex?! `${diaScripts} test apex`, isOptedOut('autoformat', null, 'git add')].filter(Boolean), '*.{graphql,yml,yaml,cmp,component,json,less,scss,sass,css}': [isOptedOut('autoformat', null, `${diaScripts} format`), isOptedOut('autoformat', null, 'git add')].filter(Boolean) };