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

Setter is defined without getter. #3381

Closed
sergey-yarchuk-4ib opened this issue Mar 29, 2019 · 6 comments
Closed

Setter is defined without getter. #3381

sergey-yarchuk-4ib opened this issue Mar 29, 2019 · 6 comments

Comments

@sergey-yarchuk-4ib
Copy link

export class Model {
	constructor(attributes = {}, options = {}) {
		//...
	}

	set(attrs, options) {
		//...
	}
}

I have a warning "Setter is defined without getter". I haven't setter or getter, have only method set()

@jugglinmike
Copy link
Member

Confirmed. Here's a further-reduced test case:

// jshint esversion: 6
void class {
  set() {}
};

This is a regression from version 2.10.0, so we'll have a fix out for this ASAP. In the mean time, you have a few options:

You could disable the warning for that method:

export class Model {
    constructor(attributes = {}, options = {}) {
        //...
    }
    /* jshint -W078 */
    set(attrs, options) {
        //...
    }
    /* jshint +W078 */
}

Or you could change the way you define the method (effectively hiding it from JSHint):

export class Model {
    constructor(attributes = {}, options = {}) {
        //...
    }
    ['set'](attrs, options) {
        //...
    }
}

Or you could downgrade to JSHint 2.9.7

Thanks for the report!

@jugglinmike
Copy link
Member

A fix is now up for review: #3382

@sergey-yarchuk-4ib
Copy link
Author

Great job. Will be wait update. Thanks for the lib.

@sergey-yarchuk-4ib
Copy link
Author

Has some one trouble with Dynamic Imports. I think this is Regression too.

const BillingListView = () => import(/* webpackChunkName: "billings-list" */ '../views/billings-list.vue');
const BillingDetailsView = () => import(/* webpackChunkName: "billing" */ '../views/billing-details.vue');

Lint message

Expected an identifier and instead saw 'import' (a reserved word).

jshint 2.10.2
webpack 4.29.6

If necessary, I can create a separate issue.

@jugglinmike
Copy link
Member

@sergey-yarchuk-4ib "Dynamic import" is a non-standard language feature. It's currently at stage 3 in the language's proposal process, so according to JSHint's policy for new language features, we would certainly accept a patch which introduced support. Would you like to file a feature request?

@exodus4d
Copy link

exodus4d commented Aug 9, 2020

@sergey-yarchuk-4ib "Dynamic imports" are st stage 4, now. tc39/proposal-dynamic-import@43e869c
see: #3457

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants