Skip to content

Commit 3da3afc

Browse files
committed
Properly adopt newer version of ESLint
1 parent 1263c06 commit 3da3afc

8 files changed

Lines changed: 71 additions & 44 deletions

File tree

.eslintrc.js

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

babel.config.js renamed to babel.config.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// You should have received a copy of the GNU Affero General Public License
1616
// along with this program. If not, see <https://www.gnu.org/licenses/>.
1717

18-
module.exports = function (api) {
18+
module.exports = function(api) {
1919
api.cache(true);
2020

2121
return {

eslint.config.mjs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import globals from "globals";
2+
import path from "node:path";
3+
import { fileURLToPath } from "node:url";
4+
import js from "@eslint/js";
5+
import { FlatCompat } from "@eslint/eslintrc";
6+
7+
const __filename = fileURLToPath(import.meta.url);
8+
const __dirname = path.dirname(__filename);
9+
const compat = new FlatCompat({
10+
baseDirectory: __dirname,
11+
recommendedConfig: js.configs.recommended,
12+
allConfig: js.configs.all
13+
});
14+
15+
export default [...compat.extends(
16+
"plugin:vue/recommended",
17+
"eslint:recommended",
18+
"prettier",
19+
"plugin:prettier/recommended",
20+
), {
21+
languageOptions: {
22+
globals: {
23+
...globals.node,
24+
$nuxt: true,
25+
},
26+
27+
ecmaVersion: 13,
28+
sourceType: "module",
29+
30+
parserOptions: {
31+
parser: "@babel/eslint-parser",
32+
},
33+
},
34+
35+
rules: {
36+
"vue/component-name-in-template-casing": ["error", "PascalCase"],
37+
"vue/multi-word-component-names": "off",
38+
"no-console": "off",
39+
"no-debugger": "off",
40+
"no-unused-vars": "warn",
41+
},
42+
}];

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.0.0",
44
"description": "Sshwifty Web Front-end Project",
55
"main": "",
6+
"type": "module",
67
"devDependencies": {
78
"@azurity/pure-nerd-font": "^3.0.4",
89
"@babel/core": "^7.26.9",

preset.json.example

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[
2+
{
3+
"Title": "Testing telnet server",
4+
"Type": "Telnet",
5+
"Host": "sshwifty-telnet-test:5555",
6+
"Meta": {}
7+
},
8+
]

ui/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import Home from "./home.vue";
3232
import "./landing.css";
3333
import Loading from "./loading.vue";
3434
import { Socket } from "./socket.js";
35-
import * as stream from "./stream/common";
35+
import * as stream from "./stream/common.js";
3636
import * as xhr from "./xhr.js";
3737

3838
const backendQueryRetryDelay = 2000;

ui/commands/common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// You should have received a copy of the GNU Affero General Public License
1616
// along with this program. If not, see <https://www.gnu.org/licenses/>.
1717

18-
import * as buffer from "buffer/";
18+
import * as buffer from "buffer";
1919
import * as iconv from "iconv-lite";
2020
import Exception from "./exception.js";
2121

webpack.config.js

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,22 @@
1515
// You should have received a copy of the GNU Affero General Public License
1616
// along with this program. If not, see <https://www.gnu.org/licenses/>.
1717

18-
const webpack = require("webpack"),
19-
{ spawn } = require("child_process"),
20-
path = require("path"),
21-
os = require("os"),
22-
HtmlWebpackPlugin = require("html-webpack-plugin"),
23-
MiniCssExtractPlugin = require("mini-css-extract-plugin"),
24-
CssMinimizerPlugin = require("css-minimizer-webpack-plugin"),
25-
ImageMinimizerPlugin = require("image-minimizer-webpack-plugin"),
26-
{ VueLoaderPlugin } = require("vue-loader"),
27-
WebpackFavicons = require("webpack-favicons"),
28-
CopyPlugin = require("copy-webpack-plugin"),
29-
TerserPlugin = require("terser-webpack-plugin"),
30-
{ CleanWebpackPlugin } = require("clean-webpack-plugin"),
31-
ESLintPlugin = require("eslint-webpack-plugin");
32-
18+
import webpack from "webpack";
19+
import { spawn } from "child_process";
20+
import path from "path";
21+
import os from "os";
22+
import HtmlWebpackPlugin from "html-webpack-plugin";
23+
import MiniCssExtractPlugin from "mini-css-extract-plugin";
24+
import CssMinimizerPlugin from "css-minimizer-webpack-plugin";
25+
import ImageMinimizerPlugin from "image-minimizer-webpack-plugin";
26+
import { VueLoaderPlugin } from "vue-loader";
27+
import WebpackFavicons from "webpack-favicons";
28+
import CopyPlugin from "copy-webpack-plugin";
29+
import TerserPlugin from "terser-webpack-plugin";
30+
import { CleanWebpackPlugin } from "clean-webpack-plugin";
31+
import ESLintPlugin from "eslint-webpack-plugin";
32+
33+
const __dirname = path.resolve(path.dirname(''));
3334
const inDevMode = process.env.NODE_ENV === "development";
3435

3536
process.traceDeprecation = true;
@@ -183,7 +184,7 @@ const killAllProc = () => {
183184
process.on("SIGTERM", killAllProc);
184185
process.on("SIGINT", killAllProc);
185186

186-
module.exports = {
187+
export default {
187188
entry: {
188189
app: path.join(__dirname, "ui", "app.js"),
189190
},

0 commit comments

Comments
 (0)