chore: Also handle typescript files in eslint

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2024-06-13 14:27:59 +02:00
parent f42ab52037
commit 369c33ce8a
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF
4 changed files with 6 additions and 11 deletions

View file

@ -15,6 +15,7 @@ module.exports = {
}, },
extends: [ extends: [
'@nextcloud', '@nextcloud',
'@nextcloud/eslint-config/typescript',
'plugin:cypress/recommended', 'plugin:cypress/recommended',
], ],
env: { env: {

View file

@ -15,8 +15,8 @@
"build": "NODE_ENV=production webpack --progress --config webpack.js", "build": "NODE_ENV=production webpack --progress --config webpack.js",
"dev": "NODE_ENV=development webpack --progress --config webpack.js", "dev": "NODE_ENV=development webpack --progress --config webpack.js",
"watch": "NODE_ENV=development webpack --progress --watch --config webpack.js", "watch": "NODE_ENV=development webpack --progress --watch --config webpack.js",
"lint": "eslint --ext .js,.vue src", "lint": "eslint --ext .js,.vue,.ts,.tsx src",
"lint:fix": "eslint --ext .js,.vue src --fix", "lint:fix": "eslint --ext .js,.vue,.ts,.tsx src --fix",
"lint:cypress": "eslint --ext .js cypress", "lint:cypress": "eslint --ext .js cypress",
"stylelint": "stylelint src/**/*.vue src/**/*.scss src/**/*.css css/*.scss", "stylelint": "stylelint src/**/*.vue src/**/*.scss src/**/*.css css/*.scss",
"stylelint:fix": "stylelint src/**/*.vue src/**/*.scss src/**/*.css css/*.scss --fix", "stylelint:fix": "stylelint src/**/*.vue src/**/*.scss src/**/*.css css/*.scss --fix",

View file

@ -9,9 +9,10 @@
"jsx": "react", "jsx": "react",
"allowJs": true "allowJs": true
}, },
"include": ["src/**/*.tsx"], "include": ["src/**/*.ts", "src/**/*.tsx"],
"exclude": [ "exclude": [
"node_modules", "node_modules",
"vendor" "vendor"
] ],
"typeRoots": ["node_modules/@types", "src/types"]
} }

View file

@ -28,13 +28,6 @@ webpackRules.RULE_JS.exclude = BabelLoaderExcludeNodeModulesExcept([
// Replaces rules array // Replaces rules array
webpackConfig.module.rules = Object.values(webpackRules) webpackConfig.module.rules = Object.values(webpackRules)
// Add typescript rule
webpackConfig.module.rules.push({
test: /\.tsx?$/,
use: ['babel-loader', 'ts-loader'],
exclude: /node_modules/,
})
// Raw files rule // Raw files rule
webpackConfig.module.rules.push({ webpackConfig.module.rules.push({
resourceQuery: /raw/, resourceQuery: /raw/,