Skip to content

Commit

Permalink
add Bareborn Install
Browse files Browse the repository at this point in the history
  • Loading branch information
ryota-murakami committed May 29, 2023
1 parent b383091 commit 9a9b7c6
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 4 deletions.
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@

----

## Installation via npm()
Barebone Install
## Installation via node_module(general way)
If you want to manage `.eslintrc.js` file on your codebase, please choose [Barebone Install](#Bareborn Install).

### 1. install necessary packages.

```bash
Expand Down Expand Up @@ -84,6 +85,32 @@ If you don't have `.prettierrc`, please `touch .prettierrc` and set prettier rul
}
```

## Bareborn Install
Bareborn Install is creates the eslint-config-ts-prefixer's `.eslintconfig.js` file directly in your code base.
You can manage the rules yourself.

### 1. install necessary packages.

```bash
npm install --save-dev eslint @typescript-eslint/eslint-plugin @typescript-eslint/parser typescript eslint-plugin-import eslint-import-resolver-typescript eslint-plugin-prettier eslint-plugin-sort-keys-fix prettier @babel/eslint-plugin eslint-plugin-babel eslint-plugin-flowtype eslint-plugin-react eslint-plugin-standard eslint-plugin-unicorn eslint-plugin-vue
```
or using yarn

```bash
yarn add -D eslint @typescript-eslint/eslint-plugin @typescript-eslint/parser typescript eslint-plugin-import eslint-import-resolver-typescript eslint-plugin-prettier eslint-plugin-sort-keys-fix prettier @babel/eslint-plugin eslint-plugin-babel eslint-plugin-flowtype eslint-plugin-react eslint-plugin-standard eslint-plugin-unicorn eslint-plugin-vue
```

or using pnpm

```bash
pnpm add -D eslint @typescript-eslint/eslint-plugin @typescript-eslint/parser typescript eslint-plugin-import eslint-import-resolver-typescript eslint-plugin-prettier eslint-plugin-sort-keys-fix prettier @babel/eslint-plugin eslint-plugin-babel eslint-plugin-flowtype eslint-plugin-react eslint-plugin-standard eslint-plugin-unicorn eslint-plugin-vue
```

### 2. run `npx eslint-config-ts-prefixer barebone`

run `npx eslint-config-ts-prefixer barebone` and then generated `.eslintrc.js`, `.eslintignore`, `.prettierrc`.


## LICENSE

MIT
Expand Down
15 changes: 13 additions & 2 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const process = require('node:process')
const { Command } = require('commander')
const inquirer = require('inquirer')
const program = new Command()
program.name('eslint-config-ts-prefixer')

const rootDir = path.join(__dirname, '..')
const configDir = path.join(rootDir, 'template', 'config')
Expand All @@ -29,7 +30,6 @@ const destination = {
prettierrc: path.join(currentDir, file.prettierrc),
}

program.name('eslint-config-ts-prefixer')
// npx eslint-config-ts-prefixer config
program
.command('config')
Expand All @@ -49,9 +49,20 @@ program
})

// npx eslint-config-ts-prefixer barebone
program
.command('barebone')
.description('barebone install')
.action(async () => {
fs.copyFileSync(
path.join(rootDir, 'index.js'),
path.join(currentDir, '.eslintrc.js')
)
await copyConfig('eslintignore')
await createPrettierConfig()
})

// run
program.parse()
program.parse(process.argv)

// functions
async function createESLintConfig() {
Expand Down

0 comments on commit 9a9b7c6

Please sign in to comment.