Skip to content

Commit f6ffa9f

Browse files
authored
Merge pull request #429 from cattr-app/chore/333-frontend-deps
chore(deps): upgrade framework-neutral frontend dependencies and move ESLint to flat config
2 parents 8eb10b1 + b8c64d9 commit f6ffa9f

9 files changed

Lines changed: 656 additions & 595 deletions

File tree

‎.eslintignore‎

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

‎.eslintrc.js‎

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

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ pnpm lint
495495

496496
Frontend formatting is defined by `prettier.config.js`.
497497

498-
ESLint configuration is defined by `.eslintrc.js`.
498+
ESLint configuration is defined by `eslint.config.js` (ESLint flat config).
499499

500500
The frontend currently uses Vue 2.7, Vue Router 3, Vuex 3, Laravel Mix, and Webpack 5.
501501

‎eslint.config.js‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
const js = require('@eslint/js');
2+
const globals = require('globals');
3+
const pluginVue = require('eslint-plugin-vue');
4+
const prettierRecommended = require('eslint-plugin-prettier/recommended');
5+
6+
module.exports = [
7+
{
8+
ignores: ['resources/frontend/generated/**'],
9+
},
10+
{
11+
files: ['**/*.js', '**/*.vue'],
12+
},
13+
...pluginVue.configs['flat/vue2-essential'],
14+
js.configs.recommended,
15+
prettierRecommended,
16+
{
17+
languageOptions: {
18+
ecmaVersion: 'latest',
19+
sourceType: 'module',
20+
globals: {
21+
...globals.node,
22+
...globals.browser,
23+
},
24+
},
25+
rules: {
26+
'linebreak-style': ['error', 'unix'],
27+
'prettier/prettier': 'error',
28+
'no-console': 'off',
29+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
30+
'no-unused-vars': 'off',
31+
// Added to eslint:recommended in ESLint 9; kept off to preserve the ESLint 8 rule set.
32+
'no-useless-assignment': 'off',
33+
'vue/multi-word-component-names': 'off',
34+
'vue/attributes-order': [
35+
'error',
36+
{
37+
order: [
38+
'DEFINITION',
39+
'LIST_RENDERING',
40+
'CONDITIONALS',
41+
'RENDER_MODIFIERS',
42+
'GLOBAL',
43+
'UNIQUE',
44+
'TWO_WAY_BINDING',
45+
'OTHER_DIRECTIVES',
46+
'OTHER_ATTR',
47+
'EVENTS',
48+
'CONTENT',
49+
],
50+
},
51+
],
52+
},
53+
},
54+
];

‎package.json‎

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"watch": "mix watch",
1515
"hot": "mix watch --hot",
1616
"prod": "mix --production",
17-
"lint": "eslint --ext .js,.vue -c .eslintrc.js resources/frontend/",
17+
"lint": "eslint resources/frontend/",
1818
"test": "node --test tests/js/*.test.cjs",
1919
"test:e2e": "playwright test",
2020
"test:e2e:update": "playwright test --project=visual-desktop --project=visual-mobile --update-snapshots=changed",
@@ -23,30 +23,30 @@
2323
},
2424
"dependencies": {
2525
"@amazingcat/cattr-ui": "^1.3.14",
26-
"@svgdotjs/svg.js": "^3.2.0",
26+
"@svgdotjs/svg.js": "^3.2.8",
2727
"apidoc": "0.29.0",
28-
"axios": "^1.18.5",
28+
"axios": "^1.20.0",
2929
"caret-pos": "^2.0.0",
30-
"chart.js": "^4.3.3",
31-
"color-convert": "^2.0.1",
32-
"echarts": "^5.4.3",
30+
"chart.js": "^4.6.1",
31+
"color-convert": "^3.1.3",
32+
"echarts": "^5.6.0",
3333
"events": "3.3.0",
34-
"highlight.js": "11.10.0",
35-
"js-md5": "^0.8.3",
36-
"laravel-echo": "^1.16.1",
37-
"lodash": "^4.18.0",
38-
"markdown-it": "^14.2.0",
39-
"markdown-it-highlightjs": "^4.1.0",
34+
"highlight.js": "11.12.0",
35+
"js-md5": "^0.9.2",
36+
"laravel-echo": "^2.6.1",
37+
"lodash": "^4.18.1",
38+
"markdown-it": "^14.3.3",
39+
"markdown-it-highlightjs": "^4.3.0",
4040
"markdown-it-sub": "^2.0.0",
4141
"markdown-it-sup": "^2.0.0",
4242
"moment": "2.31.0",
43-
"moment-timezone": "^0.5.45",
43+
"moment-timezone": "^0.6.5",
4444
"path-browserify": "^1.0.1",
45-
"pusher-js": "^8.4.0-rc2",
45+
"pusher-js": "^8.6.0",
4646
"quill": "1.3.7",
47-
"semver": "^7.6.0",
47+
"semver": "^7.8.5",
4848
"v-code-diff": "^1.13.1",
49-
"validator": "^13.15.22",
49+
"validator": "^13.15.35",
5050
"vee-validate": "^3.4.15",
5151
"vue": "^2.7.16",
5252
"vue-avatar": "^2.3.3",
@@ -67,15 +67,16 @@
6767
},
6868
"devDependencies": {
6969
"@babel/core": "^7.23.7",
70-
"@babel/eslint-parser": "^7.23.9",
70+
"@eslint/js": "^10.0.1",
7171
"@playwright/test": "1.64.1",
72-
"autoprefixer": "^10.4.16",
72+
"autoprefixer": "^10.6.1",
7373
"clean-webpack-plugin": "^4.0.0",
7474
"core-js": "^3.35.0",
75-
"eslint": "^8.56.0",
75+
"eslint": "^10.13.0",
7676
"eslint-config-prettier": "^10.1.8",
77-
"eslint-plugin-prettier": "^5.1.3",
78-
"eslint-plugin-vue": "^9.20.1",
77+
"eslint-plugin-prettier": "^5.5.7",
78+
"eslint-plugin-vue": "^10.12.0",
79+
"globals": "^17.13.0",
7980
"laravel-mix": "^6.0.49",
8081
"laravel-mix-bundle-analyzer": "^1.0.5",
8182
"laravel-mix-clean": "^0.1.0",
@@ -84,14 +85,14 @@
8485
"laravel-mix-serve": "^2.2.2",
8586
"laravel-mix-sri": "^1.3.0",
8687
"laravel-mix-workbox": "^0.1.4",
87-
"postcss": "^8.4.31",
88-
"prettier": "3.2.5",
88+
"postcss": "^8.5.31",
89+
"prettier": "3.9.10",
8990
"process": "0.11.10",
9091
"resolve-url-loader": "^5.0.0",
9192
"sass": "^1.70.0",
9293
"sass-loader": "^13.3.3",
9394
"sass-resources-loader": "^2.2.5",
94-
"vue-eslint-parser": "^9.4.2",
95+
"vue-eslint-parser": "^10.4.1",
9596
"vue-loader": "^15.11.1",
9697
"webpack": "^5.91.0",
9798
"workbox-webpack-plugin": "^7.4.1"

0 commit comments

Comments
 (0)