Skip to content

Commit

Permalink
fix: use .prettierrc.json instead of .js
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan authored and snorrees committed Nov 4, 2022
1 parent 909b27c commit 39a2a52
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 28 deletions.
File renamed without changes.
6 changes: 0 additions & 6 deletions assets/inject/prettierrc.js

This file was deleted.

6 changes: 6 additions & 0 deletions assets/inject/prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": false,
"printWidth": 100,
"bracketSpacing": false,
"singleQuote": true
}
2 changes: 1 addition & 1 deletion src/actions/inject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ async function writeStaticAssets(options: InjectOptions) {
},
flags.gitignore && {from: 'gitignore', to: '.gitignore'},
flags.typescript && {from: 'template-tsconfig.json', to: 'tsconfig.json'},
flags.prettier && {from: 'prettierrc.js', to: '.prettierrc.js'},
flags.prettier && {from: 'prettierrc.json', to: '.prettierrc.json'},
]
.map((f) => (f ? (f as FromTo) : undefined))
.filter((f): f is FromTo => !!f)
Expand Down
2 changes: 1 addition & 1 deletion src/configs/uselessFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const uselessFiles = [
'.gitignore',
'.github',
'.nyc_output',
'.prettierrc',
'.prettierrc.json',
'.stylelintignore',
'.stylelintrc.json',
'.stylelintrc',
Expand Down
6 changes: 0 additions & 6 deletions test/fixtures/inject/valid/.prettierrc.js

This file was deleted.

6 changes: 6 additions & 0 deletions test/fixtures/inject/valid/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": false,
"printWidth": 100,
"bracketSpacing": false,
"singleQuote": true
}
6 changes: 0 additions & 6 deletions test/fixtures/verify-package/invalid-eslint/.prettierrc.js

This file was deleted.

6 changes: 6 additions & 0 deletions test/fixtures/verify-package/invalid-eslint/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": false,
"printWidth": 100,
"bracketSpacing": false,
"singleQuote": true
}
6 changes: 0 additions & 6 deletions test/fixtures/verify-package/valid/.prettierrc.js

This file was deleted.

6 changes: 6 additions & 0 deletions test/fixtures/verify-package/valid/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": false,
"printWidth": 100,
"bracketSpacing": false,
"singleQuote": true
}
4 changes: 2 additions & 2 deletions test/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ tap.test('plugin-kit init --force in empty directory', async (t) => {
'lint-staged.config.js',
'*.js'
)
await fileContains('.prettierrc.js', 'semi: false')
await fileContains('.prettierrc.json', '"semi": false')
await fileContains('sanity.json', '"path": "./v2-incompatible.js"')
await fileContains('v2-incompatible.js', 'showIncompatiblePluginDialog')
await fileContains('tsconfig.json', '"target": "esnext"')
Expand Down Expand Up @@ -165,7 +165,7 @@ tap.test('plugin-kit init --force with all the opt-outs in empty directory', asy
await expectNotExist('LICENSE')
await expectNotExist('.eslintrc')
await expectNotExist('.gitignore')
await expectNotExist('.prettierrc.js')
await expectNotExist('.prettierrc.json')
await expectNotExist('tsconfig.json')

await fileContains('src/index.js', `name: '${pluginTestName}'`)
Expand Down

0 comments on commit 39a2a52

Please sign in to comment.