Migrate to ESLint 10 flat config

pull/1163/head
voc0der 2 months ago
parent b98df93775
commit cd314193bc

@ -1,20 +0,0 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
}
}

@ -0,0 +1,36 @@
const js = require('@eslint/js');
const globals = require('globals');
const tsPlugin = require('@typescript-eslint/eslint-plugin');
const SOURCE_FILES = ['src/**/*.{js,ts}'];
const TS_FILES = ['src/**/*.ts', 'src/**/*.tsx', 'src/**/*.mts', 'src/**/*.cts'];
const scopedTsConfigs = tsPlugin.configs['flat/recommended'].map((config) => ({
...config,
files: config.files ? config.files.map((pattern) => `src/${pattern}`) : TS_FILES,
}));
module.exports = [
{
ignores: ['node_modules/**', 'dist/**', 'coverage/**'],
linterOptions: {
reportUnusedDisableDirectives: false,
},
},
{
files: SOURCE_FILES,
languageOptions: {
ecmaVersion: 2021,
sourceType: 'module',
globals: {
...globals.browser,
...globals.es2021,
},
},
},
{
...js.configs.recommended,
files: SOURCE_FILES,
},
...scopedTsConfigs,
];

36
package-lock.json generated

@ -44,6 +44,7 @@
"@angular/cli": "^21.1.5",
"@angular/compiler-cli": "^21.1.5",
"@angular/language-service": "^21.1.5",
"@eslint/js": "^10.0.1",
"@types/core-js": "^2.5.2",
"@types/file-saver": "^2.0.1",
"@types/jasmine": "^6.0.0",
@ -52,6 +53,7 @@
"@typescript-eslint/parser": "^8.56.1",
"ajv": "^8.18.0",
"eslint": "^10.0.2",
"globals": "^17.3.0",
"jasmine-core": "~6.1.0",
"jasmine-spec-reporter": "~7.0.0",
"karma": "~6.4.2",
@ -3800,6 +3802,27 @@
"node": "^20.19.0 || ^22.13.0 || >=24"
}
},
"node_modules/@eslint/js": {
"version": "10.0.1",
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-10.0.1.tgz",
"integrity": "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==",
"dev": true,
"license": "MIT",
"engines": {
"node": "^20.19.0 || ^22.13.0 || >=24"
},
"funding": {
"url": "https://eslint.org/donate"
},
"peerDependencies": {
"eslint": "^10.0.0"
},
"peerDependenciesMeta": {
"eslint": {
"optional": true
}
}
},
"node_modules/@eslint/object-schema": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-3.0.2.tgz",
@ -10285,6 +10308,19 @@
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/globals": {
"version": "17.3.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-17.3.0.tgz",
"integrity": "sha512-yMqGUQVVCkD4tqjOJf3TnrvaaHDMYp4VlUSObbkIiuCPe/ofdMBFIAcBbCSRFWOnos6qRiTVStDwqPLUclaxIw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/gopd": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",

@ -56,6 +56,7 @@
"@angular/cli": "^21.1.5",
"@angular/compiler-cli": "^21.1.5",
"@angular/language-service": "^21.1.5",
"@eslint/js": "^10.0.1",
"@types/core-js": "^2.5.2",
"@types/file-saver": "^2.0.1",
"@types/jasmine": "^6.0.0",
@ -64,6 +65,7 @@
"@typescript-eslint/parser": "^8.56.1",
"ajv": "^8.18.0",
"eslint": "^10.0.2",
"globals": "^17.3.0",
"jasmine-core": "~6.1.0",
"jasmine-spec-reporter": "~7.0.0",
"karma": "~6.4.2",

@ -17,8 +17,8 @@ export class LinkifyPipe implements PipeTransform {
private stylize(text: string): string {
let stylizedText: string = '';
if (text && text.length > 0) {
for (let line of text.split("\n")) {
for (let t of line.split(" ")) {
for (const line of text.split("\n")) {
for (const t of line.split(" ")) {
if (t.startsWith("http") && t.length>7) {
stylizedText += `<a target="_blank" href="${t}">${t}</a> `;
}

@ -391,7 +391,7 @@ export class PostsService {
return this.http.post<GetAllFilesResponse>(this.path + 'getAllFiles', body, this.httpOptions);
}
updateFile(uid: string, change_obj: Object) {
updateFile(uid: string, change_obj: object) {
const body: UpdateFileRequest = {uid: uid, change_obj: change_obj};
return this.http.post<SuccessObject>(this.path + 'updateFile', body, this.httpOptions);
}

2
src/typings.d.ts vendored

@ -1,5 +1,5 @@
/* SystemJS module definition */
declare var module: NodeModule;
declare let module: NodeModule;
interface NodeModule {
id: string;
}

Loading…
Cancel
Save