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

ci(): Add linting #8024

Merged
merged 7 commits into from
Jun 25, 2022
Merged

ci(): Add linting #8024

merged 7 commits into from
Jun 25, 2022

Conversation

asturur
Copy link
Member

@asturur asturur commented Jun 25, 2022

  • update eslint to latest to support the typescript
  • create a new command and configuration to lint ts files in order to slowly eliminate the old one
  • pickup the default configuration ( that we probably will going to slighty change depending on preferences )
  • fix the necessary changes in the test files in order for the new lint to pass

@@ -12,7 +12,7 @@ import { halfPI } from '../constants';
*/
export const cos = (angle: TRadian): number => {
if (angle === 0) { return 1; }
var angleSlice = Math.abs(angle) / halfPI;
const angleSlice = Math.abs(angle) / halfPI;
Copy link
Member Author

Choose a reason for hiding this comment

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

first lint request, at leat it works.

Copy link
Contributor

Choose a reason for hiding this comment

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

fabulous

@@ -1,5 +1,6 @@
(function (global) {
var fabric = global.fabric;
/* this file needs to go away, cross browser style support is not fabricjs domain.
Copy link
Member Author

Choose a reason for hiding this comment

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

i didn't know we had this, but we need to remove it. Is probably for old days.
Safari eventuall doesn't support yet opacity in stile, meaning that opacity in style shouldn't be used imho.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am shocked that opacity isn't supported... WHY?
Well, how does it affect fabric?

Copy link
Member Author

Choose a reason for hiding this comment

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

it doesn't. I think that if you pass a style object to the canvas, we transfer it on the container using this setStyle function.
And if for some weird reason you want your canvas with the opacity style property.
But really is not our problem to fix.

@@ -35,7 +36,7 @@
var parseEl = fabric.document.createElement('div'),
supportsOpacity = typeof parseEl.style.opacity === 'string',
supportsFilters = typeof parseEl.style.filter === 'string',
reOpacity = /alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,
reOpacity = /alpha\s*\(\s*opacity\s*=\s*([^)]+)\)/,
Copy link
Member Author

Choose a reason for hiding this comment

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

another lint caught thing

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that linting now works for us

Copy link
Member Author

Choose a reason for hiding this comment

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

it was working even before, but our lint config lacked lint-recommended plugin, and had just the old formatting rules.

@asturur
Copy link
Member Author

asturur commented Jun 25, 2022

@ShaMan123 @melchiar have a look if you see something noteworthy.
In theory old lint does not change ( no changes to the code indeed apart a bug that i committed on its own ), new lint is whatever it is, test lint was and is still a mess.

Copy link
Contributor

@ShaMan123 ShaMan123 left a comment

Choose a reason for hiding this comment

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

I gave this a quick look.
Seems fine. I didn't drill down to every change and regarding rules - I'm not very knowledgeable and I understand we'll get there in the near future

@@ -10,6 +10,18 @@
"pixelmatch": true
Copy link
Contributor

Choose a reason for hiding this comment

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

can't we use the eslint file for tests as well or extend it somehow?
Because globals should extend src globals, shouldn't they?

Copy link
Member Author

Choose a reason for hiding this comment

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

it was setup like this ages ago, in theory we want to add to the normal config a bunch of globals for qunit and nothing else, but that requires extensive reformatting of tests files.
But yes we want extend the tests config from the source configuration

@asturur asturur merged commit 2af0c08 into rollup-no-ws Jun 25, 2022
@asturur asturur deleted the add-linting branch September 11, 2022 23:03
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.

2 participants