Skip to content

Commit

Permalink
lint/prettier updates (#331)
Browse files Browse the repository at this point in the history
lint/prettier updates
  • Loading branch information
alexdiliberto authored Nov 3, 2019
2 parents 9de3305 + ada713f commit f30b5e9
Show file tree
Hide file tree
Showing 18 changed files with 120 additions and 43 deletions.
9 changes: 5 additions & 4 deletions .ember-cli → .ember-cli.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
'use strict';

module.exports = {
/**
Ember CLI sends analytics information by default. The data is completely
anonymous, but there are times when you might want to disable this behavior.

Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": false
}
disableAnalytics: false
};
19 changes: 7 additions & 12 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,18 @@ module.exports = {
legacyDecorators: true
}
},
plugins: [
'ember'
],
plugins: ['ember', 'prettier', 'qunit'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'@alexdiliberto'
'plugin:qunit/recommended',
'@alexdiliberto',
'plugin:prettier/recommended'
],
env: {
browser: true
},
rules: {
'no-debugger': 0,
'indent': 0, // HACK: Removes error `Cannot read property 'range' of null`
'ember/classic-decorator-hooks': 'error',
'ember/classic-decorator-no-classic-methods': 'error',
'ember/no-jquery': 'error'
Expand All @@ -30,7 +28,9 @@ module.exports = {
// node files
{
files: [
'.ember-cli.js',
'.eslintrc.js',
'.prettierrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'index.js',
Expand All @@ -39,12 +39,7 @@ module.exports = {
'config/**/*.js',
'tests/dummy/config/**/*.js'
],
excludedFiles: [
'addon/**',
'addon-test-support/**',
'app/**',
'tests/dummy/app/**'
],
excludedFiles: ['addon/**', 'addon-test-support/**', 'app/**', 'tests/dummy/app/**'],
parserOptions: {
sourceType: 'script'
},
Expand Down
12 changes: 12 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use strict';

module.exports = {
singleQuote: true,
trailingComma: 'none',
printWidth: 100,
semi: true,
bracketSpacing: true,
endOfLine: 'lf',
tabs: false,
tabWidth: 2
};
9 changes: 6 additions & 3 deletions addon/components/t-add.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export default class TAddComponent extends Component {
* Animation CSS classname lookup table for the Add transformicon
*/
animationTypeTable = {
'minus': 'tcon-plus--minus',
'check': 'tcon-plus--check'
minus: 'tcon-plus--minus',
check: 'tcon-plus--check'
};

/**
Expand All @@ -61,7 +61,10 @@ export default class TAddComponent extends Component {
this.toggleProperty('isAdded');

if (this.onClick) {
assert(`[ember-transformicons] ${this.toString()} \`onClick\` action handler must be a valid closure action`, typeof this.onClick === 'function');
assert(
`[ember-transformicons] ${this.toString()} \`onClick\` action handler must be a valid closure action`,
typeof this.onClick === 'function'
);

this.onClick(this.isAdded);
}
Expand Down
5 changes: 4 additions & 1 deletion addon/components/t-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ export default class TFormComponent extends Component {
this.toggleProperty('isSearching');

if (this.onClick) {
assert(`[ember-transformicons] ${this.toString()} \`onClick\` action handler must be a valid closure action`, typeof this.onClick === 'function');
assert(
`[ember-transformicons] ${this.toString()} \`onClick\` action handler must be a valid closure action`,
typeof this.onClick === 'function'
);

this.onClick(this.isSearching);
}
Expand Down
9 changes: 6 additions & 3 deletions addon/components/t-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export default class TGridComponent extends Component {
* Animation CSS classname lookup table for the Grid transformicon
*/
animationTypeTable = {
'rearrange': 'tcon-grid--rearrange',
'collapse': 'tcon-grid--collapse'
rearrange: 'tcon-grid--rearrange',
collapse: 'tcon-grid--collapse'
};

/**
Expand All @@ -61,7 +61,10 @@ export default class TGridComponent extends Component {
this.toggleProperty('isOpen');

if (this.onClick) {
assert(`[ember-transformicons] ${this.toString()} \`onClick\` action handler must be a valid closure action`, typeof this.onClick === 'function');
assert(
`[ember-transformicons] ${this.toString()} \`onClick\` action handler must be a valid closure action`,
typeof this.onClick === 'function'
);

this.onClick(this.isOpen);
}
Expand Down
5 changes: 4 additions & 1 deletion addon/components/t-mail.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ export default class TMailComponent extends Component {
this.toggleProperty('isOpen');

if (this.onClick) {
assert(`[ember-transformicons] ${this.toString()} \`onClick\` action handler must be a valid closure action`, typeof this.onClick === 'function');
assert(
`[ember-transformicons] ${this.toString()} \`onClick\` action handler must be a valid closure action`,
typeof this.onClick === 'function'
);

this.onClick(this.isOpen);
}
Expand Down
9 changes: 6 additions & 3 deletions addon/components/t-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export default class TMenuComponent extends Component {
* Animation CSS classname lookup table for the Menu transformicon
*/
animationTypeTable = {
'butterfly': 'tcon-menu--xbutterfly',
'minus': 'tcon-menu--minus',
butterfly: 'tcon-menu--xbutterfly',
minus: 'tcon-menu--minus',
'x-cross': 'tcon-menu--xcross',
'arrow-up': 'tcon-menu--arrow tcon-menu--arrowup',
'arrow-360-left': 'tcon-menu--arrow tcon-menu--arrow360left',
Expand Down Expand Up @@ -65,7 +65,10 @@ export default class TMenuComponent extends Component {
this.toggleProperty('isOpen');

if (this.onClick) {
assert(`[ember-transformicons] ${this.toString()} \`onClick\` action handler must be a valid closure action`, typeof this.onClick === 'function');
assert(
`[ember-transformicons] ${this.toString()} \`onClick\` action handler must be a valid closure action`,
typeof this.onClick === 'function'
);

this.onClick(this.isOpen);
}
Expand Down
9 changes: 6 additions & 3 deletions addon/components/t-remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ export default class TRemoveComponent extends Component {
* Animation CSS classname lookup table for the Remove transformicon
*/
animationTypeTable = {
'check': 'tcon-remove--check',
check: 'tcon-remove--check',
'chevron-left': 'tcon-remove--chevron-left',
'chevron-right': 'tcon-remove--chevron-right',
'chevron-down': 'tcon-remove--chevron-down',
'chevron-up': 'tcon-remove--chevron-up'
}
};

/**
* Get the component's current animation type. This is used to lookup the CSS classname for the
Expand All @@ -64,7 +64,10 @@ export default class TRemoveComponent extends Component {
this.toggleProperty('isRemoved');

if (this.onClick) {
assert(`[ember-transformicons] ${this.toString()} \`onClick\` action handler must be a valid closure action`, typeof this.onClick === 'function');
assert(
`[ember-transformicons] ${this.toString()} \`onClick\` action handler must be a valid closure action`,
typeof this.onClick === 'function'
);

this.onClick(this.isRemoved);
}
Expand Down
5 changes: 4 additions & 1 deletion addon/components/t-video.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ export default class TVideoComponent extends Component {
this.toggleProperty('isPlaying');

if (this.onClick) {
assert(`[ember-transformicons] ${this.toString()} \`onClick\` action handler must be a valid closure action`, typeof this.onClick === 'function');
assert(
`[ember-transformicons] ${this.toString()} \`onClick\` action handler must be a valid closure action`,
typeof this.onClick === 'function'
);

this.onClick(this.isPlaying);
}
Expand Down
2 changes: 1 addition & 1 deletion config/environment.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

module.exports = function(/* environment, appConfig */) {
return { };
return {};
};
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"start": "ember serve",
"test": "ember test",
"test:all": "ember try:each",
"lint:fix": "yarn lint -- --fix",
"start:inspect": "node --inspect-brk node_modules/.bin/ember s",
"test:iterate": "ember exam:iterate 10",
"version": "git-chglog --next-tag v$npm_package_version -o CHANGELOG.md && git add CHANGELOG.md",
Expand Down Expand Up @@ -82,9 +81,13 @@
"ember-source": "~3.13.0",
"ember-source-channel-url": "^2.0.1",
"ember-try": "^1.2.1",
"eslint-config-prettier": "^6.5.0",
"eslint-plugin-ember": "^7.1.0",
"eslint-plugin-node": "^10.0.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-qunit": "^4.0.0",
"loader.js": "4.7.0",
"prettier": "^1.18.2",
"qunit-dom": "^0.9.0"
},
"engines": {
Expand Down
8 changes: 2 additions & 6 deletions testem.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
module.exports = {
test_page: 'tests/index.html?hidepassed',
disable_watching: true,
launch_in_ci: [
'Chrome'
],
launch_in_dev: [
'Chrome'
],
launch_in_ci: ['Chrome'],
launch_in_dev: ['Chrome'],
browser_args: {
Chrome: {
ci: [
Expand Down
4 changes: 3 additions & 1 deletion tests/dummy/app/controllers/docs/transformicons/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export default class TransformiconsFormController extends Controller {

@action
updateFormAction(isSearching) {
console.info(`updateFormAction was triggered with the following arguments: isSearching=${isSearching}`);
console.info(
`updateFormAction was triggered with the following arguments: isSearching=${isSearching}`
);
}
}
4 changes: 3 additions & 1 deletion tests/dummy/app/controllers/docs/transformicons/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export default class TransformiconsMenuController extends Controller {

@action
updateMenuAction(isMenuOpen) {
console.info(`updateMenuAction was triggered with the following arguments: isMenuOpen=${isMenuOpen}`);
console.info(
`updateMenuAction was triggered with the following arguments: isMenuOpen=${isMenuOpen}`
);
}
}
4 changes: 3 additions & 1 deletion tests/dummy/app/controllers/docs/transformicons/remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export default class TransformiconsRemoveController extends Controller {

@action
updateRemoveAction(isRemoved) {
console.info(`updateRemoveAction was triggered with the following arguments: isRemoved=${isRemoved}`);
console.info(
`updateRemoveAction was triggered with the following arguments: isRemoved=${isRemoved}`
);
}
}
4 changes: 3 additions & 1 deletion tests/dummy/app/controllers/docs/transformicons/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export default class TransformiconsVideoController extends Controller {

@action
updateVideoAction(isPlaying) {
console.info(`updateVideoAction was triggered with the following arguments: isPlaying=${isPlaying}`);
console.info(
`updateVideoAction was triggered with the following arguments: isPlaying=${isPlaying}`
);
}
}
41 changes: 41 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6510,6 +6510,13 @@ esdoc@pzuraq/esdoc#015a342:
minimist "1.2.0"
taffydb "2.7.2"

eslint-config-prettier@^6.5.0:
version "6.5.0"
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.5.0.tgz#aaf9a495e2a816865e541bfdbb73a65cc162b3eb"
integrity sha512-cjXp8SbO9VFGW/Z7mbTydqS9to8Z58E5aYhj3e1+Hx7lS9s6gL5ILKNpCqZAFOVYRcSkWPFYljHrEh8QFEK5EQ==
dependencies:
get-stdin "^6.0.0"

eslint-plugin-ember@^7.1.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-ember/-/eslint-plugin-ember-7.1.0.tgz#1ae46ead1f17efa489e2dcba3fe3880b95fc162b"
Expand Down Expand Up @@ -6539,6 +6546,18 @@ eslint-plugin-node@^10.0.0:
resolve "^1.10.1"
semver "^6.1.0"

eslint-plugin-prettier@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.1.tgz#507b8562410d02a03f0ddc949c616f877852f2ba"
integrity sha512-A+TZuHZ0KU0cnn56/9mfR7/KjUJ9QNVXUhwvRFSR7PGPe0zQR6PTkmyqg1AtUUEOzTqeRsUwyKFh0oVZKVCrtA==
dependencies:
prettier-linter-helpers "^1.0.0"

eslint-plugin-qunit@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-qunit/-/eslint-plugin-qunit-4.0.0.tgz#5945ba3434bfe8879bea195192e906701051cf01"
integrity sha512-+0i2xcYryUoLawi47Lp0iJKzkP931G5GXwIOq1KBKQc2pknV1VPjfE6b4mI2mR2RnL7WRoS30YjwC9SjQgJDXQ==

eslint-scope@^4.0.0, eslint-scope@^4.0.3:
version "4.0.3"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848"
Expand Down Expand Up @@ -6862,6 +6881,11 @@ fast-deep-equal@^2.0.1:
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49"
integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=

fast-diff@^1.1.2:
version "1.2.0"
resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03"
integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==

fast-glob@^2.2.6:
version "2.2.7"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.2.7.tgz#6953857c3afa475fff92ee6015d52da70a4cd39d"
Expand Down Expand Up @@ -7399,6 +7423,11 @@ get-stdin@^4.0.1:
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe"
integrity sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=

get-stdin@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b"
integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==

[email protected], get-stream@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14"
Expand Down Expand Up @@ -10807,6 +10836,18 @@ prepend-http@^2.0.0:
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897"
integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=

prettier-linter-helpers@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b"
integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==
dependencies:
fast-diff "^1.1.2"

prettier@^1.18.2:
version "1.18.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea"
integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==

pretty-ms@^3.1.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-3.2.0.tgz#87a8feaf27fc18414d75441467d411d6e6098a25"
Expand Down

0 comments on commit f30b5e9

Please sign in to comment.