Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
tinchox5 committed Mar 21, 2024
1 parent 4778ecc commit 986699a
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Node modules
node_modules/

package-lock.json

# Dependencias de desarrollo
npm-debug.log
yarn-debug.log*
yarn-error.log*

# Carpeta de construcción
build/
dist/

# Archivos de configuración
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Dependencias específicas de IDE
.vscode/
.idea/

# Archivos de respaldo y temporales
*.log
*.tmp
*.bak
*.swp
*~

# Carpeta de almacenamiento de datos
.db/

# Archivos de caché
.cache/

# Archivos generados en la compilación
*.class
*.jar
*.war
*.ear
*.exe
*.dll
*.so
*.obj
*.o
*.a
*.lib
*.out
*.log

21 changes: 21 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"arrowParens": "always",
"bracketSameLine": false,
"bracketSpacing": true,
"semi": false,
"experimentalTernaries": true,
"singleQuote": true,
"jsxSingleQuote": true,
"quoteProps": "as-needed",
"trailingComma": "none",
"singleAttributePerLine": false,
"htmlWhitespaceSensitivity": "css",
"vueIndentScriptAndStyle": false,
"proseWrap": "preserve",
"insertPragma": false,
"printWidth": 80,
"requirePragma": false,
"tabWidth": 2,
"useTabs": false,
"embeddedLanguageFormatting": "auto"
}
16 changes: 16 additions & 0 deletions bin/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env node

const { execSync } = require('child_process')
const path = require('path')

try {
const configPath = path.resolve(__dirname, '../.prettierrc.json')
let args = process.argv.slice(2).join(' ')
const result = execSync(
`prettier "{.,docs,src,bin,test,mocks,app}/**/*.{js,html,md}" --config ${configPath} --check ${args}`,
{ stdio: 'inherit' }
)
if (result !== null) console.log(result)
} catch (error) {
console.log('Run again Prettier with --write arg to fix code style')
}
15 changes: 15 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "@tinybox/code-format",
"version": "0.1.0",
"description": "",
"main": "./bin/index.js",
"bin": "./bin/index.js",
"scripts": {
"start": "./bin/index.js"
},
"author": "Juan Martin Muda",
"license": "MIT",
"dependencies": {
"prettier": "^3.2.5"
}
}

0 comments on commit 986699a

Please sign in to comment.