Skip to content

Commit

Permalink
Use overrides for better multi-file-format control of prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Apr 18, 2023
1 parent d1fa81c commit 17110f6
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 14 deletions.
13 changes: 10 additions & 3 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
'use strict';

module.exports = {
singleQuote: true,
trailingComma: 'es5',
printWidth: 120,
arrowParens: 'avoid',
overrides: [
{
files: '*{js,ts}',
options: {
trailingComma: 'es5',
arrowParens: 'avoid',
singleQuote: true,
},
},
],
};
10 changes: 5 additions & 5 deletions test-packages/sample-transforms/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ language: node_js
node_js:
# we recommend testing addons with the same minimum supported node version as Ember CLI
# so that your addon works for all apps
- '8'
- "8"

sudo: false
dist: trusty
Expand Down Expand Up @@ -33,22 +33,22 @@ jobs:
include:
# runs linting and tests with current locked deps

- stage: 'Tests'
name: 'Tests'
- stage: "Tests"
name: "Tests"
install:
- yarn install --non-interactive
script:
- yarn lint:hbs
- yarn lint:js
- yarn test

- name: 'Floating Dependencies'
- name: "Floating Dependencies"
script:
- yarn test

# we recommend new addons test the current and previous LTS
# as well as latest stable release (bonus points to beta/canary)
- stage: 'Additional Tests'
- stage: "Additional Tests"
env: EMBER_TRY_SCENARIO=ember-lts-2.18
- env: EMBER_TRY_SCENARIO=ember-lts-3.4
- env: EMBER_TRY_SCENARIO=ember-release
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<h2 id='title'>Welcome to Ember</h2>
<h2 id="title">Welcome to Ember</h2>

{{outlet}}
9 changes: 8 additions & 1 deletion tests/addon-template/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
'use strict';

module.exports = {
singleQuote: true,
overrides: [
{
files: '*{js,ts}',
options: {
singleQuote: true,
},
},
],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{page-title 'Dummy'}}
{{page-title "Dummy"}}

<h2 id='title'>Welcome to Ember</h2>
<h2 id="title">Welcome to Ember</h2>

{{outlet}}
12 changes: 12 additions & 0 deletions tests/app-template/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use strict';

module.exports = {
overrides: [
{
files: '*{js,ts}',
options: {
singleQuote: true,
},
},
],
};
6 changes: 5 additions & 1 deletion tests/app-template/config/targets.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
'use strict';

const browsers = ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions'];
const browsers = [
'last 1 Chrome versions',
'last 1 Firefox versions',
'last 1 Safari versions',
];

module.exports = {
browsers,
Expand Down
2 changes: 1 addition & 1 deletion tests/ts-app-template/app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{{page-title 'TsAppTemplate'}}
{{page-title "TsAppTemplate"}}

{{outlet}}

0 comments on commit 17110f6

Please sign in to comment.