🇪🇬 Made in Egypt
🤓 11 years of console.log('whyyyyyy!!!!')
👨🏻💻 Frontend Lead @ Curalie
~1000 files, ~11 developers, ~4 monthsahmed.rocks
___________
"Yeah it's cool, but we are busy now"
"It's not worth the effort"
"I tried flow before, never again!"
"I don’t need a tool to tell me what to do."
| Phase 1 | Phase 2 | |
|---|---|---|
| allow js | ✅ | ❌ |
| allow any/unknown | ✅ | ❌ |
| refactoring logic | ❌ | ✅ |
| strict mode | ❌ | ✅ |
Button.js
App.js
LoginForm.js
1
2
3
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
rules: {
// javascript rules
'prettier/prettier': 'error',
},
settings: {
'import/resolver': 'typescript',
'import/extensions': ['.js', '.jsx', '.ts', '.tsx', '.json'],
react: {
version: 'detect',
},
},
overrides: [
{
files: ['src/**/*.ts', 'src/**/*.tsx'],
rules: {
// typescript rules
'curalie/type-default-props': 'error',
},
parserOptions: {
project: 'tsconfig.json',
},
},
],
};
| Editor/Hooks | CI | |
|---|---|---|
| Fast | ✅ | ❌ |
| Free | ✅ | ❌ |
| Dependable | ❌ | ✅ |
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
}
{
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"eslint --fix"
],
"*": [
"prettier --ignore-unknown --write"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
}
},
}{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"command": "npm run migrate -- \"${file}\"",
"problemMatcher": [],
"label": "Migrate file to TS",
"detail": "Runs the npm migrate script"
}
]
}