From: Jérôme Benoit Date: Mon, 24 Apr 2023 12:53:48 +0000 (+0200) Subject: build(ci): fix sonar-scanner, take 2 X-Git-Tag: v1.2.12~94 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=0f4540150dd0b9c8bf96b92182413237e9ac0491;p=e-mobility-charging-stations-simulator.git build(ci): fix sonar-scanner, take 2 Signed-off-by: Jérôme Benoit --- diff --git a/.eslintrc.json b/.eslintrc.json index 7a97530e..702effbc 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -15,7 +15,7 @@ "settings": { "import/resolver": { "typescript": { - "project": "./tsconfig-base.json" + "project": "./tsconfig.json" } } }, @@ -143,7 +143,7 @@ "files": ["**/*.ts"], "parser": "@typescript-eslint/parser", "parserOptions": { - "project": "./tsconfig-base.json" + "project": "./tsconfig.json" }, "plugins": ["@typescript-eslint", "eslint-plugin-tsdoc"], "extends": [ diff --git a/.prettierignore b/.prettierignore index f2ccb990..79840942 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,7 +2,7 @@ coverage dist outputs .nyc_output -tsconfig.json +tsconfig-base.json pnpm-lock.yaml package-lock.json performanceRecords.json diff --git a/docker/Dockerfile b/docker/Dockerfile index c2785752..96fefe3b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,7 +2,7 @@ FROM node:lts-alpine as builder # Build simulator WORKDIR /usr/builder -COPY .npmrc package.json pnpm-lock.yaml tsconfig.json tsconfig-base.json rollup.config.mjs build-requirements.mjs skip-preinstall.cjs prepare.cjs ./ +COPY .npmrc package.json pnpm-lock.yaml tsconfig-base.json tsconfig.json rollup.config.mjs build-requirements.mjs skip-preinstall.cjs prepare.cjs ./ COPY src ./src COPY docker/config.json ./src/assets/config.json COPY docker/idtags.json ./src/assets/idtags.json diff --git a/rollup.config.mjs b/rollup.config.mjs index 1e9c26b8..0b43e8f8 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -57,7 +57,7 @@ export default { plugins: [ json(), typescript({ - tsconfig: 'tsconfig-base.json', + tsconfig: 'tsconfig.json', }), del({ targets: [ diff --git a/sonar-project.properties b/sonar-project.properties index 3d4ba1cb..69fe3fdf 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -11,5 +11,7 @@ sonar.tests=test sonar.javascript.lcov.reportPaths=coverage/lcov.info +sonar.typescript.tsconfigPath=tsconfig-base.json + # Encoding of the source code. Default is default system encoding #sonar.sourceEncoding=UTF-8 diff --git a/tsconfig-base.json b/tsconfig-base.json index de296721..e3dba047 100644 --- a/tsconfig-base.json +++ b/tsconfig-base.json @@ -1,6 +1,72 @@ { - "extends": "./tsconfig.json", + "$schema": "https://json.schemastore.org/tsconfig", "compilerOptions": { - "verbatimModuleSyntax": true - } + /* Visit https://aka.ms/tsconfig.json to read more about this file */ + + /* Basic Options */ + // "incremental": true, /* Enable incremental compilation */ + "target": "es2022", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ + "module": "esnext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ + "lib": ["es2022"], /* Specify library files to be included in the compilation. */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + // "checkJs": true, /* Report errors in .js files. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ + "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + "outDir": "./dist", /* Redirect output structure to the directory. */ + "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "composite": true, /* Enable project compilation */ + // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ + "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ + + /* Strict Type-Checking Options */ + // "strict": true, /* Enable all strict type-checking options. */ + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "strictFunctionTypes": true, /* Enable strict checking of function types. */ + // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ + // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + /* Module Resolution Options */ + "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + "resolveJsonModule": true, /* Resolve modules imported with '.json' extension. */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + + /* Source Map Options */ + // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + + /* Advanced Options */ + // "skipLibCheck": true, /* Skip type checking of declaration files. */ + "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ + }, + "exclude": ["ui/web/**/*.ts"] } diff --git a/tsconfig-orm.json b/tsconfig-orm.json index 36852caa..2c7b2841 100644 --- a/tsconfig-orm.json +++ b/tsconfig-orm.json @@ -1,5 +1,5 @@ { - "extends": "./tsconfig-base.json", + "extends": "./tsconfig.json", "compilerOptions": { "module": "commonjs" } diff --git a/tsconfig.json b/tsconfig.json index e3dba047..9d2cfe73 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,72 +1,6 @@ { - "$schema": "https://json.schemastore.org/tsconfig", + "extends": "./tsconfig-base.json", "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ - - /* Basic Options */ - // "incremental": true, /* Enable incremental compilation */ - "target": "es2022", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ - "module": "esnext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ - "lib": ["es2022"], /* Specify library files to be included in the compilation. */ - // "allowJs": true, /* Allow javascript files to be compiled. */ - // "checkJs": true, /* Report errors in .js files. */ - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - // "declaration": true, /* Generates corresponding '.d.ts' file. */ - // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ - "sourceMap": true, /* Generates corresponding '.map' file. */ - // "outFile": "./", /* Concatenate and emit output to single file. */ - "outDir": "./dist", /* Redirect output structure to the directory. */ - "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - // "composite": true, /* Enable project compilation */ - // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ - "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ - // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - - /* Strict Type-Checking Options */ - // "strict": true, /* Enable all strict type-checking options. */ - // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* Enable strict null checks. */ - // "strictFunctionTypes": true, /* Enable strict checking of function types. */ - // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ - // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - - /* Additional Checks */ - // "noUnusedLocals": true, /* Report errors on unused locals. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - - /* Module Resolution Options */ - "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - "resolveJsonModule": true, /* Resolve modules imported with '.json' extension. */ - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - // "types": [], /* Type declaration files to be included in compilation. */ - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ - // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - - /* Source Map Options */ - // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - - /* Experimental Options */ - "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - - /* Advanced Options */ - // "skipLibCheck": true, /* Skip type checking of declaration files. */ - "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ - }, - "exclude": ["ui/web/**/*.ts"] + "verbatimModuleSyntax": true + } } diff --git a/ui/web/sonar-project.properties b/ui/web/sonar-project.properties index 395315d5..1e33c42b 100644 --- a/ui/web/sonar-project.properties +++ b/ui/web/sonar-project.properties @@ -11,5 +11,7 @@ sonar.tests=tests # sonar.javascript.lcov.reportPaths=coverage/lcov.info +sonar.typescript.tsconfigPath=tsconfig-base.json + # Encoding of the source code. Default is default system encoding #sonar.sourceEncoding=UTF-8 diff --git a/ui/web/tsconfig-base.json b/ui/web/tsconfig-base.json deleted file mode 100644 index d594040c..00000000 --- a/ui/web/tsconfig-base.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig", - "extends": [ - "@tsconfig/node20/tsconfig.json", - "@vue/tsconfig/tsconfig.json" - ] -} diff --git a/ui/web/tsconfig.json b/ui/web/tsconfig.json index 964bfb73..bfd63b8a 100644 --- a/ui/web/tsconfig.json +++ b/ui/web/tsconfig.json @@ -1,5 +1,9 @@ { - "extends": "./tsconfig-base.json", + "$schema": "https://json.schemastore.org/tsconfig", + "extends": [ + "@tsconfig/node20/tsconfig.json", + "@vue/tsconfig/tsconfig.json" + ], "compilerOptions": { "experimentalDecorators": true, "allowSyntheticDefaultImports": true,