Skip to content

Commit 56aa32b

Browse files
committed
Added JS files formatting with Prettier (#2573)
* Added Prettier and ESlint config * Prettier formatting * Remove obsolete files * [CI] Added CI step * Adjusted code highlighting * Migration from node-sass to sass * Added yarn.lock to gitignore * Bumped version
1 parent 4c58e28 commit 56aa32b

File tree

18 files changed

+45
-148
lines changed

18 files changed

+45
-148
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
**/webpack.config.js
2+
vendor

.eslintrc.json

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,3 @@
11
{
2-
"plugins": ["prettier"],
3-
"extends": ["prettier", "eslint:recommended"],
4-
"env": {
5-
"browser": true,
6-
"commonjs": true,
7-
"es6": true,
8-
"node": true
9-
},
10-
"parser": "babel-eslint",
11-
"parserOptions": {
12-
"ecmaFeatures": {
13-
"jsx": true,
14-
"classes": true,
15-
"experimentalObjectRestSpread": true
16-
},
17-
"sourceType": "module"
18-
},
19-
"rules": {
20-
"no-const-assign": "warn",
21-
"no-console": "off",
22-
"no-this-before-super": "warn",
23-
"no-undef": "warn",
24-
"no-unreachable": "warn",
25-
"no-unused-vars": "warn",
26-
"constructor-super": "warn",
27-
"valid-typeof": "warn",
28-
"no-extra-semi": "error",
29-
"no-extra-boolean-cast": "off"
30-
}
2+
"extends": "eslint-config-ibexa/eslint"
313
}

.github/workflows/build.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ jobs:
3535
- name: Run PHP CS Fixer
3636
run: tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots
3737

38+
- name: Run Prettier
39+
run: |
40+
yarn install
41+
yarn prettier-test --write
42+
3843
- name: Commit changes
3944
uses: stefanzweifel/git-auto-commit-action@v4
4045
with:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ __pycache__/*
66
.php-cs-fixer.cache
77
composer.lock
88
tools/php-cs-fixer/vendor
9+
node_modules/
10+
.yarn
11+
yarn.lock

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/webpack.config.js

code_samples/back_office/image_editor/assets/random_dot/random-dot-stem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ ibexa.addConfig(
2929
icon: ibexa.helpers.icon.getIconPath('radio-button'), // Path to an icon that will be displayed in the UI
3030
identifier: IDENTIFIER, // The identifier must match the one from the configuration yaml file
3131
},
32-
true
32+
true,
3333
);

code_samples/back_office/image_editor/assets/random_dot/random-dot.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,5 @@ ibexa.addConfig(
6565
icon: ibexa.helpers.icon.getIconPath('radio-button'),
6666
identifier: IDENTIFIER,
6767
},
68-
true
68+
true,
6969
);

code_samples/back_office/online_editor/assets/js/online_editor/buttons/date.js

Lines changed: 0 additions & 41 deletions
This file was deleted.

code_samples/back_office/online_editor/assets/js/online_editor/buttons/hr.js

Lines changed: 0 additions & 48 deletions
This file was deleted.

code_samples/back_office/online_editor/assets/js/online_editor/plugins/date.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
const InsertDate = {
77
exec: function (editor) {
88
const now = new Date();
9-
editor.insertHtml( now.toString() );
9+
editor.insertHtml(now.toString());
1010
},
1111
};
12-
12+
1313
global.CKEDITOR.plugins.add('date', {
1414
init: (editor) => editor.addCommand('InsertDate', InsertDate),
1515
});

0 commit comments

Comments
 (0)