diff --git a/.eslintrc.js b/.eslintrc.js index ac27e8e..0c24d42 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -9,7 +9,7 @@ module.exports = { 'eslint:recommended', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', - 'prettier/@typescript-eslint', + 'prettier', ], ignorePatterns: ["webpack.config.js"], rules: { diff --git a/package.json b/package.json index 2170bcc..d8937ed 100644 --- a/package.json +++ b/package.json @@ -1,34 +1,34 @@ -{ - "name": "fivem-ts-boilerplate", - "version": "2.1.1", - "description": "Typescript Boilerplate for FiveM", - "main": "index.js", - "repository": "https://github.com/d0p3t/fivem-ts-boilerplate", - "author": "d0p3t ", - "scripts": { - "build": "webpack --mode production", - "format": "prettier --write \"src/**/*.ts\"", - "lint": "eslint . --ext .js,.jsx,.ts,.tsx", - "watch": "webpack --mode development --watch true" - }, - "license": "MIT", - "private": false, - "dependencies": { - "@citizenfx/client": "^1.0.2792-1", - "@citizenfx/server": "^1.0.2792-1", - "@types/node": "^14.0.27" - }, - "devDependencies": { - "@typescript-eslint/eslint-plugin": "^3.8.0", - "@typescript-eslint/parser": "^2.34.0", - "eslint": "^7.6.0", - "eslint-config-prettier": "^6.11.0", - "eslint-loader": "^4.0.2", - "prettier": "^2.0.5", - "remove-files-webpack-plugin": "^1.4.3", - "ts-loader": "^8.0.2", - "typescript": "^3.9.7", - "webpack": "^4.44.1", - "webpack-cli": "^3.3.12" - } -} +{ + "name": "fivem-ts-boilerplate", + "version": "2.1.1", + "description": "TypeScript Boilerplate for FiveM", + "main": "index.js", + "repository": "https://github.com/d0p3t/fivem-ts-boilerplate", + "author": "d0p3t ", + "scripts": { + "build": "webpack --mode production", + "format": "prettier --write \"src/**/*.ts\"", + "lint": "eslint . --ext .js,.jsx,.ts,.tsx", + "watch": "webpack --mode development --watch" + }, + "license": "MIT", + "private": false, + "dependencies": { + "@citizenfx/client": "^2.0.6129-1", + "@citizenfx/server": "^2.0.6129-1", + "@types/node": "^18.11.12" + }, + "devDependencies": { + "@typescript-eslint/eslint-plugin": "^5.46.0", + "@typescript-eslint/parser": "^5.46.0", + "eslint": "^8.29.0", + "eslint-config-prettier": "^8.5.0", + "eslint-loader": "^4.0.2", + "prettier": "^2.8.1", + "remove-files-webpack-plugin": "^1.5.0", + "ts-loader": "^9.4.2", + "typescript": "^4.9.4", + "webpack": "^5.75.0", + "webpack-cli": "^5.0.1" + } +} diff --git a/webpack.config.js b/webpack.config.js index b44c8a4..db16212 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,8 +1,8 @@ const webpack = require('webpack'); const path = require('path'); const RemovePlugin = require('remove-files-webpack-plugin'); - const buildPath = path.resolve(__dirname, 'dist'); +const eslintWebpackPlugin = require('eslint-webpack-plugin'); const server = { entry: './src/server/server.ts', @@ -10,12 +10,13 @@ const server = { rules: [ { test: /\.tsx?$/, - use: ['ts-loader', 'eslint-loader'], + use: ['ts-loader'], exclude: /node_modules/, }, ], }, plugins: [ + new eslintWebpackPlugin(), new webpack.DefinePlugin({ 'global.GENTLY': false }), new RemovePlugin({ before: { @@ -49,12 +50,13 @@ const client = { rules: [ { test: /\.tsx?$/, - use: ['ts-loader', 'eslint-loader'], + use: ['ts-loader'], exclude: /node_modules/, }, ], }, plugins: [ + new eslintWebpackPlugin(), new RemovePlugin({ before: { include: [