UNPKG

@yanhe-su/cli

Version:

CLI tool for DAO Style projects - providing project scaffolding, template generation and dependency management

64 lines (63 loc) 2.78 kB
import path from 'path'; import { fileURLToPath } from 'node:url'; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); export const lintTemplate = { name: 'lint', path: path.resolve(__dirname, 'files'), transform: (data) => { return { ...data, devDependencies: { ...data.devDependencies, '@commitlint/cli': '^16.0.2', '@commitlint/config-conventional': '^16.0.0', '@commitlint/cz-commitlint': '^16.0.0', '@typescript-eslint/eslint-plugin': '^6.0.0', '@typescript-eslint/parser': '^6.0.0', '@vue/eslint-config-typescript': '^13.0.0', commitizen: '^4.2.4', eslint: '^8.35.0', 'eslint-config-airbnb-base': '^15.0.0', 'eslint-plugin-import': '2.26.0', 'eslint-plugin-jsonc': '^2.7.0', 'eslint-plugin-node': '^11.1.0', 'eslint-plugin-promise': '^6.4.0', 'eslint-plugin-vue': '^9.27.0', husky: '^8.0.3', 'lint-staged': '^15.2.7', stylelint: '^14.3.0', 'stylelint-config-recess-order': '^3.0.0', 'stylelint-config-recommended-vue': '^1.1.0', 'stylelint-config-sass-guidelines': '^9.0.1', textlint: '^13.4.1', 'textlint-plugin-json': '^0.0.1', 'textlint-rule-ja-space-between-half-and-full-width': '^2.3.0', 'vue-eslint-parser': '^9.1.0', }, config: { ...data.config, commitizen: { path: '@commitlint/cz-commitlint', }, }, scripts: { prepare: 'husky install', lint: 'pnpm run lint:style && pnpm run lint:es && pnpm run lint:type && pnpm run lint:doc', commit: 'git-cz', 'lint:es': 'eslint "src/**/*.{js,jsx,ts,tsx,vue,json}" --config .eslintrc.js --fix --max-warnings=0', 'lint:style': 'stylelint "src/**/*.{vue,scss,css}" --config .stylelintrc.js --fix', 'lint:doc': 'prettier "**/**.json" --write --ignore-unknown && textlint "**/*.json" --config .textlintrc.json --fix', 'lint:type': 'vue-tsc --build --force', 'lint:fix': 'eslint . --ext .vue,.js,.ts,.jsx,.tsx --fix', }, gitHooks: { 'pre-commit': 'lint-staged', 'commit-msg': 'commitlint -E GIT_PARAMS', }, 'lint-staged': { '*.{js,ts,vue,jsx,tsx}': ['eslint --fix'], }, }; }, };