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

Improve box model analysis #138

Merged
merged 3 commits into from
Jan 9, 2019
Merged

Improve box model analysis #138

merged 3 commits into from
Jan 9, 2019

Conversation

yume-chan
Copy link
Contributor

I always have css.lint.boxModel on, but what I usually want to do is to override properties from other css files.

.element {
    width: 60px;
    padding: 0 !important;
}

The problem is, VS Code keeps warning me about this: Do not use width or height when using padding or border.

Does padding: 0 really counts as using?

So instead of turn this feature off, I'd love to make it be aware of what I'm doing.

src/services/boxModel.ts Outdated Show resolved Hide resolved
@@ -24,3 +24,19 @@ export function findFirst<T>(array: T[], p: (x: T) => boolean): number {
}
return low;
}

export function includes<T>(array: T[], item: T): boolean {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, add es2016.array.include to compilerOptions.lib in the tsconfig.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find any statement about engine requirement (which version of node or browser it will run on), so I didn't modify lib config.

@aeschli aeschli added this to the December/January 2019 milestone Jan 9, 2019
@aeschli aeschli merged commit 7c7ac61 into microsoft:master Jan 9, 2019
@aeschli
Copy link
Contributor

aeschli commented Jan 9, 2019

Thanks @KamasamaK, I reviewed the changes, but renamed the new file to be also used by future lint rules.

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

Successfully merging this pull request may close these issues.

3 participants