Skip to content

Commit

Permalink
Merge pull request #360 from adopted-ember-addons/bump-prettier
Browse files Browse the repository at this point in the history
Bump prettier to v3 and add trailing commas
  • Loading branch information
SergeAstapov authored Nov 8, 2024
2 parents 946bad7 + 1df5174 commit 36824a4
Show file tree
Hide file tree
Showing 24 changed files with 1,409 additions and 32,178 deletions.
14 changes: 8 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

module.exports = {
root: true,
parser: 'babel-eslint',
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 2018,
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
requireConfigFile: false,
babelOptions: {
plugins: [
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
],
},
},
plugins: ['ember'],
Expand Down Expand Up @@ -42,8 +45,7 @@ module.exports = {
browser: false,
node: true,
},
plugins: ['node'],
extends: ['plugin:node/recommended'],
extends: ['plugin:n/recommended'],
},
{
// Test files:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: 12.x
node-version: 16.x
cache: npm
- name: Install Dependencies
run: npm ci
Expand All @@ -34,7 +34,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12.x
node-version: 16.x
cache: npm
- name: Install Dependencies
run: npm install --no-shrinkwrap
Expand All @@ -49,7 +49,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12.x
node-version: 16.x
cache: npm
- name: Install Dependencies
run: npm install --no-shrinkwrap
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: 12.x
node-version: 16.x
cache: npm
- name: Install Dependencies
run: npm ci
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions addon/utils/get-messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let cachedRef = null;
*/
export default function getMessages(
moduleMap = requirejs.entries,
useCache = true
useCache = true,
) {
let messagesModule = defaultMessages;

Expand All @@ -36,7 +36,7 @@ export default function getMessages(
// Merge the user specified messages with the defaults
messagesModule = withDefaults(
requireModule(moduleKey).default,
messagesModule
messagesModule,
);
}

Expand Down
8 changes: 4 additions & 4 deletions addon/utils/handle-multiple-validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { isPromise } from 'validated-changeset';
*/
function handleValidations(validations = []) {
let rejectedValidations = emberArray(validations).reject(
(validation) => typeOf(validation) === 'boolean' && validation
(validation) => typeOf(validation) === 'boolean' && validation,
);

return rejectedValidations.length === 0 || rejectedValidations;
Expand All @@ -34,12 +34,12 @@ function handleValidations(validations = []) {
*/
export default function handleMultipleValidations(
validators,
{ key, newValue, oldValue, changes, content }
{ key, newValue, oldValue, changes, content },
) {
let validations = emberArray(
validators.map((validator) =>
validator(key, newValue, oldValue, changes, content)
)
validator(key, newValue, oldValue, changes, content),
),
);

if (emberArray(validations).any(isPromise)) {
Expand Down
6 changes: 3 additions & 3 deletions addon/utils/validation-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@ export default function buildMessage(key, result) {
let builtMessage = message(key, type, value, context);
assert(
'Custom message function must return a string',
typeof builtMessage === 'string'
typeof builtMessage === 'string',
);

return builtMessage;
}

return messages.formatMessage(
message,
Object.assign({ description }, context)
Object.assign({ description }, context),
);
}

return messages.formatMessage(
message,
Object.assign({ description }, context)
Object.assign({ description }, context),
);
}
2 changes: 1 addition & 1 deletion node-test/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
mocha: true,
},
rules: {
'node/no-unpublished-require': [
'n/no-unpublished-require': [
'error',
{
// ESLint complaints but it's just devDependencies and used only in tests.
Expand Down
6 changes: 3 additions & 3 deletions node-test/blueprints/validator-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ describe('Acceptance: ember generate and destroy validator', function () {
return emberNew().then(() =>
emberGenerateDestroy(args, (file) => {
expect(file('app/validators/is-positive.js')).to.contain(
'export default function validateIsPositive(/* options = {} */) {\n'
'export default function validateIsPositive(/* options = {} */) {\n',
);
expect(file('tests/unit/validators/is-positive-test.js'))
.to.contain(
"import validateIsPositive from 'my-app/validators/is-positive';"
"import validateIsPositive from 'my-app/validators/is-positive';",
)
.to.contain("module('Unit | Validator | is-positive');")
.to.contain('assert.ok(validateIsPositive());');
})
}),
);
});
});
Loading

0 comments on commit 36824a4

Please sign in to comment.