Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Ember 3.26.1 blueprint; fix deprecations #365

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .bowerrc

This file was deleted.

1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# misc
/coverage/
!.*
.eslintcache

# ember-try
/.node_modules.ember-try/
Expand Down
28 changes: 14 additions & 14 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,48 @@ module.exports = {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true
}
legacyDecorators: true,
},
},
plugins: [
'ember'
],
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true
browser: true,
},
rules: {},
overrides: [
// node files
{
files: [
'.eslintrc.js',
'.prettierrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'index.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'tests/dummy/config/**/*.js'
'tests/dummy/config/**/*.js',
],
excludedFiles: [
'addon/**',
'addon-test-support/**',
'app/**',
'tests/dummy/app/**'
'tests/dummy/app/**',
],
parserOptions: {
sourceType: 'script'
sourceType: 'script',
},
env: {
browser: false,
node: true
node: true,
},
plugins: ['node'],
extends: ['plugin:node/recommended']
}
]
extends: ['plugin:node/recommended'],
},
],
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/.env*
/.pnp*
/.sass-cache
/.eslintcache
/connect.lock
/coverage/
/libpeerconnection.log
Expand Down
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@
/.editorconfig
/.ember-cli
/.env*
/.eslintcache
/.eslintignore
/.eslintrc.js
/.git/
/.gitignore
/.prettierignore
/.prettierrc.js
/.template-lintrc.js
/.travis.yml
/.watchmanconfig
Expand Down
21 changes: 21 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*
.eslintcache

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
5 changes: 5 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
singleQuote: true,
};
2 changes: 1 addition & 1 deletion .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

module.exports = {
extends: 'octane'
extends: 'octane',
};
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@

## Linting

* `yarn lint:hbs`
* `yarn lint:js`
* `yarn lint:js -- --fix`
* `yarn lint`
* `yarn lint:fix`

## Running tests

Expand Down
13 changes: 2 additions & 11 deletions addon/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
import {
Inflector,
defaultRules,
pluralize,
singularize
} from "./lib/system";
import { Inflector, defaultRules, pluralize, singularize } from './lib/system';

export default Inflector;

export {
pluralize,
singularize,
defaultRules
};
export { pluralize, singularize, defaultRules };
2 changes: 1 addition & 1 deletion addon/lib/helpers/pluralize.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default makeHelper(function (params, hash) {
let fullParams = new Array(...params);

if (fullParams.length === 2) {
fullParams.push({ withoutCount: hash["without-count"] })
fullParams.push({ withoutCount: hash['without-count'] });
}

return pluralize(...fullParams);
Expand Down
2 changes: 1 addition & 1 deletion addon/lib/helpers/singularize.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import makeHelper from '../utils/make-helper';
* @for Ember.HTMLBars.helpers
* @method singularize
* @param {String|Property} word word to singularize
*/
*/
export default makeHelper(function (params) {
return singularize(params[0]);
});
15 changes: 4 additions & 11 deletions addon/lib/system.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import Inflector from "./system/inflector";
import {
pluralize,
singularize
} from "./system/string";

export {
Inflector,
singularize,
pluralize
};
import Inflector from './system/inflector';
import { pluralize, singularize } from './system/string';

export { Inflector, singularize, pluralize };
15 changes: 9 additions & 6 deletions addon/lib/system/inflections.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@ export default {
[/^(m|l)ice$/i, '$1ice'],
[/^(ox)$/i, '$1en'],
[/^(oxen)$/i, '$1'],
[/(quiz)$/i, '$1zes']
[/(quiz)$/i, '$1zes'],
],

singular: [
[/s$/i, ''],
[/(ss)$/i, '$1'],
[/(n)ews$/i, '$1ews'],
[/([ti])a$/i, '$1um'],
[/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)$/i, '$1sis'],
[
/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)$/i,
'$1sis',
],
[/(^analy)(sis|ses)$/i, '$1sis'],
[/([^f])ves$/i, '$1fe'],
[/(hive)s$/i, '$1'],
Expand All @@ -50,7 +53,7 @@ export default {
[/(vert|ind)ices$/i, '$1ex'],
[/(matr)ices$/i, '$1ix'],
[/(quiz)zes$/i, '$1'],
[/(database)s$/i, '$1']
[/(database)s$/i, '$1'],
],

irregularPairs: [
Expand All @@ -60,7 +63,7 @@ export default {
['sex', 'sexes'],
['move', 'moves'],
['cow', 'kine'],
['zombie', 'zombies']
['zombie', 'zombies'],
],

uncountable: [
Expand All @@ -73,6 +76,6 @@ export default {
'fish',
'sheep',
'jeans',
'police'
]
'police',
],
};
Loading