Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Attempt to fix specs #741

Closed
wants to merge 7 commits into from
Closed
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
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
Expand Down
59 changes: 56 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
/* eslint-env node */
'use strict';

module.exports = {
plugins: ['smile-ember'],
extends: ['plugin:smile-ember/addon'],
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
},
// NOTE removed eslint-plugin-smile-ember for now, it's hard to maintain between ember upgrades.
// Will look to just have a plugin with our rules instead of Ember's too
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true,
},
rules: {
// Temporary while upgrading to Ember Octane & Glimmer components
'ember/no-jquery': 'off',
Expand All @@ -19,4 +36,40 @@ module.exports = {
// These are a lil broken right now (eslint-plugin-ember also disabled these)
'smile-ember/order-in-components': 'off',
},
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',
],
excludedFiles: [
'addon/**',
'addon-test-support/**',
'app/**',
'tests/dummy/app/**',
],
parserOptions: {
sourceType: 'script',
},
env: {
browser: false,
node: true,
},
plugins: ['node'],
extends: ['plugin:node/recommended'],
},
{
// Test files:
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
],
};
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
/.eslintrc.js
/.git/
/.gitignore
/.prettierignore
/.prettierrc.js
/.template-lintrc.js
/.travis.yml
Expand All @@ -25,6 +26,7 @@
/ember-cli-build.js
/testem.js
/tests/
/yarn-error.log
/yarn.lock
.gitkeep

Expand Down
2 changes: 0 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try

*.md
5 changes: 4 additions & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
'use strict';

module.exports = require('@smile-io/ember-styleguide/.prettierrc');
module.exports = {
singleQuote: true,
...require('@smile-io/ember-styleguide/.prettierrc'),
};
2 changes: 1 addition & 1 deletion .template-lintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module.exports = {
plugins: ['./node_modules/@smile-io/ember-styleguide/.template-lintrc'],
extends: ['@smile-io/ember-styleguide:recommended'],
extends: ['recommended', '@smile-io/ember-styleguide:recommended'],
rules: {
'attribute-indentation': false,
'no-inline-styles': false,
Expand Down
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ ember-polaris
Compatibility
------------------------------------------------------------------------------

* Ember.js v3.16 or above
* Ember CLI v2.13 or above
* Ember.js v3.20 or above
* Ember CLI v3.20 or above
* Node.js v10 or above


Expand Down
1 change: 0 additions & 1 deletion addon/components/polaris-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export default class PolarisButton extends Component {
* @default null
* @public
*/
// eslint-disable-next-line smile-ember/order-in-components
id = null;

/**
Expand Down
8 changes: 2 additions & 6 deletions addon/components/polaris-data-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,8 @@ export default class PolarisDataTable extends Component.extend(

@action
navigateTable(direction) {
let {
currentColumn,
previousColumn,
fixedColumnWidth,
scrollContainer,
} = this;
let { currentColumn, previousColumn, fixedColumnWidth, scrollContainer } =
this;

if (!currentColumn || !previousColumn || !fixedColumnWidth) {
return;
Expand Down
5 changes: 2 additions & 3 deletions addon/components/polaris-drop-zone.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,8 @@ export default class PolarisDropZone extends Component.extend(
return;
}
let fileList = getDataTransferFiles(event);
let { files, acceptedFiles, rejectedFiles } = this.getValidatedFiles(
fileList
);
let { files, acceptedFiles, rejectedFiles } =
this.getValidatedFiles(fileList);

this.set('dragTargets', []);

Expand Down
7 changes: 3 additions & 4 deletions addon/components/polaris-resource-list/bulk-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,17 +340,16 @@ export default class PolarisResourceListBulkActions extends Component.extend(
warn(
`To provide a better user experience. There should only be a maximum of ${MAX_PROMOTED_ACTIONS} promoted actions.`,
{
id:
'ember-polaris.polaris-resource-list.bulk-actions.max-promoted-actions',
id: 'ember-polaris.polaris-resource-list.bulk-actions.max-promoted-actions',
}
);
}

this.addResizeEventListener();

if (promotedActions && !actionsCollection && moreActionsNode) {
addedMoreActionsWidthForMeasuring = moreActionsNode.getBoundingClientRect()
.width;
addedMoreActionsWidthForMeasuring =
moreActionsNode.getBoundingClientRect().width;
}

let bulkActionsWidth = largeScreenButtonsNode
Expand Down
1 change: 0 additions & 1 deletion addon/components/polaris-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ export default class PolarisSelect extends Component {
*
* @type {String}
*/
// eslint disable smile-ember/order-in-components
@computed('id')
get _id() {
return this.id || guidFor(this);
Expand Down
2 changes: 1 addition & 1 deletion addon/templates/components/polaris-option-list.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
@section={{sectionIndex}}
@index={{optionIndex}}
@onClick={{this.handleClick}}
@select={{array-contains @selected option.value}}
@select={{includes option.value @selected}}
@allowMultiple={{@allowMultiple}}
@role={{@optionRole}}
/>
Expand Down
5 changes: 4 additions & 1 deletion config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

const getChannelURL = require('ember-source-channel-url');
const { embroiderSafe, embroiderOptimized } = require('@embroider/test-setup');

module.exports = async function () {
return {
Expand All @@ -18,7 +19,7 @@ module.exports = async function () {
name: 'ember-lts-3.24',
npm: {
devDependencies: {
'ember-source': '~3.24.0',
'ember-source': '~3.24.3',
},
},
},
Expand Down Expand Up @@ -77,6 +78,8 @@ module.exports = async function () {
},
},
},
embroiderSafe(),
embroiderOptimized(),
],
};
};
3 changes: 2 additions & 1 deletion ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ module.exports = function (defaults) {
*/
app.import('node_modules/ember-source/dist/ember-template-compiler.js');

return app.toTree();
const { maybeEmbroider } = require('@embroider/test-setup');
return maybeEmbroider(app);
};
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ module.exports = {
name: require('./package').name,

options: {
'ember-composable-helpers': {
only: ['includes'],
},
svgJar: {
sourceDirs: [
'public',
Expand Down
46 changes: 24 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"scripts": {
"build": "ember build --environment=production",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel 'lint:!(fix)'",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
"lint:hbs": "ember-template-lint .",
"lint:hbs:fix": "ember-template-lint . --fix",
Expand All @@ -54,67 +54,69 @@
"broccoli-funnel": "^3.0.0",
"broccoli-merge-trees": "^4.2.0",
"chalk": "^4.0.0",
"ember-array-contains-helper": "^2.0.0",
"ember-auto-import": "^1.10.1",
"ember-basic-dropdown": "^3.0.11",
"ember-cli-babel": "^7.23.1",
"ember-cli-htmlbars": "^5.3.2",
"ember-auto-import": "^1.11.3",
"ember-basic-dropdown": "^3.0.19",
"ember-cli-babel": "^7.26.6",
"ember-cli-htmlbars": "^5.7.1",
"ember-cli-sass": "^10.0.1",
"ember-composable-helpers": "4.5.0",
"ember-context": "^0.1.0",
"ember-decorators": "^6.1.1",
"ember-element-helper": "^0.5.0",
"ember-event-helpers": "^0.1.0",
"ember-keyboard": "^6.0.1",
"ember-keyboard": "^6.0.3",
"ember-lifeline": "^4.1.5",
"ember-render-detector": "^1.0.0",
"ember-svg-jar": "^2.2.3",
"ember-truth-helpers": "^3.0.0",
"fs-extra": "^9.0.0",
"fs-extra": "^10.0.0",
"node-sass": "^5.0.0",
"resolve": "^1.11.1",
"rsvp": "^4.8.5"
},
"devDependencies": {
"@ember/optional-features": "2.0.0",
"@ember/test-helpers": "2.2.8",
"@embroider/test-setup": "0.42.3",
"@glimmer/component": "1.0.4",
"@glimmer/tracking": "1.0.4",
"@smile-io/changelog-generator": "2.1.0",
"@smile-io/ember-styleguide": "9.2.1",
"@smile-io/ember-styleguide": "9.3.0",
"babel-eslint": "10.1.0",
"broccoli-asset-rev": "3.0.0",
"ember-array-helper": "5.1.0",
"ember-cli": "3.25.3",
"ember-cli": "3.27.0",
"ember-cli-code-coverage": "1.0.3",
"ember-cli-dependency-checker": "3.2.0",
"ember-cli-deprecation-workflow": "1.0.1",
"ember-cli-inject-live-reload": "2.0.2",
"ember-cli-deprecation-workflow": "2.0.0",
"ember-cli-inject-live-reload": "2.1.0",
"ember-cli-release": "1.0.0-beta.2",
"ember-cli-sri": "2.1.1",
"ember-cli-terser": "4.0.2",
"ember-disable-prototype-extensions": "1.1.3",
"ember-export-application-global": "2.0.1",
"ember-load-initializers": "2.1.2",
"ember-maybe-import-regenerator": "0.1.6",
"ember-page-title": "6.2.1",
"ember-page-title": "6.2.2",
"ember-qunit": "5.1.4",
"ember-resolver": "8.0.2",
"ember-source": "3.26.1",
"ember-source": "3.27.5",
"ember-source-channel-url": "3.0.0",
"ember-template-lint": "3.2.0",
"ember-test-selectors": "5.3.0",
"ember-template-lint": "3.5.0",
"ember-test-selectors": "6.0.0",
"ember-try": "1.4.0",
"eslint": "7.20.0",
"eslint-config-prettier": "8.1.0",
"eslint-plugin-ember": "10.2.0",
"eslint": "7.30.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-ember": "10.5.1",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-prettier": "3.3.1",
"eslint-plugin-smile-ember": "9.1.0",
"eslint-plugin-prettier": "3.4.0",
"eslint-plugin-qunit": "6.2.0",
"eslint-plugin-smile-ember": "10.0.0",
"husky": "6.0.0",
"loader.js": "4.7.0",
"npm-run-all": "4.1.5",
"precise-commits": "1.0.2",
"prettier": "2.2.1",
"prettier": "2.3.2",
"qunit": "2.16.0",
"qunit-dom": "1.6.0"
},
Expand Down
2 changes: 1 addition & 1 deletion tests/dummy/config/ember-cli-update.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"packages": [
{
"name": "ember-cli",
"version": "3.25.3",
"version": "3.27.0",
"blueprints": [
{
"name": "addon",
Expand Down
20 changes: 14 additions & 6 deletions tests/dummy/config/targets.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,20 @@ const browsers = [
'last 1 Safari versions',
];

const isCI = Boolean(process.env.CI);
const isProduction = process.env.EMBER_ENV === 'production';

if (isCI || isProduction) {
browsers.push('ie 11');
}
// Ember's browser support policy is changing, and IE11 support will end in
// v4.0 onwards.
//
// See https://deprecations.emberjs.com/v3.x#toc_3-0-browser-support-policy
//
// If you need IE11 support on a version of Ember that still offers support
// for it, uncomment the code block below.
//
// const isCI = Boolean(process.env.CI);
// const isProduction = process.env.EMBER_ENV === 'production';
//
// if (isCI || isProduction) {
// browsers.push('ie 11');
// }

module.exports = {
browsers,
Expand Down
Loading