yarn add --dev wttj-config
// .eslintrc.js
module.exports = {
extends: './node_modules/wttj-config/lib/eslint',
// or if you want typescript configuration
// extends: './node_modules/wttj-config/lib/eslint/eslintrc-typescript',
// or if you want cypress configuration
// extends: './node_modules/wttj-config/lib/eslint/eslintrc-cypress',
}
// prettier.config.js
module.exports = require('wttj-config/lib/prettier')
// stylelint.config.js
module.exports = {
extends: './node_modules/wttj-config/lib/stylelint',
}
// tsconfig.json
{
"extends": "wttj-config/lib/tsconfig/tsconfig.json",
"compilerOptions": {
"baseUrl": "src"
},
"include": ["src"]
}
We've added a script to run as a lint task that ensures that the keys in translation files are sorted alphabetically.
// package.json
{
"scripts": {
// ...
"lint": "yarn lint:js && yarn lint:css && yarn lint:ts && yarn lint:translations",
"lint:js": "eslint src --max-warnings 0",
"lint:css": "stylelint 'src/**/styles.ts' --allow-empty-input",
"lint:ts": "tsc --noEmit",
"lint:translations": "node -r esm scripts/sort-translations.js",
}
},
Install eslint and prettier extensions
// your settings.json
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
yarn release
Then release-it create a new github tag who activate circle ci release action.