diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1fab0c9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +name: CI + +on: + push: + pull_request: + branches: + - master + schedule: + - cron: '0 0 * * *' + +jobs: + node18: + name: Node 18 + runs-on: ubuntu-24.04 + steps: + - name: checkout + uses: actions/checkout@v4 + - name: checkout node + uses: actions/setup-node@v4 + with: + node-version: '18' + - run: npm install + node20: + name: Node 20 + runs-on: ubuntu-24.04 + steps: + - name: checkout + uses: actions/checkout@v4 + - name: checkout node + uses: actions/setup-node@v4 + with: + node-version: '20' + - run: npm install + node22: + name: Node 22 + runs-on: ubuntu-24.04 + steps: + - name: checkout + uses: actions/checkout@v4 + - name: checkout node + uses: actions/setup-node@v4 + with: + node-version: '22' + - run: npm install + - run: npm run cs + - name: sonarcloud.io + uses: sonarsource/sonarqube-scan-action@v4.1.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/README.md b/README.md index befc18f..1e2c612 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,19 @@ # chubbyts-eslint +[![CI](https://github.com/chubbyts/chubbyts-eslint/workflows/CI/badge.svg?branch=master)](https://github.com/chubbyts/chubbyts-eslint/actions?query=workflow%3ACI) [![npm-version](https://img.shields.io/npm/v/@chubbyts/chubbyts-eslint.svg)](https://www.npmjs.com/package/@chubbyts/chubbyts-eslint) +[![bugs](https://sonarcloud.io/api/project_badges/measure?project=chubbyts_chubbyts-eslint&metric=bugs)](https://sonarcloud.io/dashboard?id=chubbyts_chubbyts-eslint) +[![code_smells](https://sonarcloud.io/api/project_badges/measure?project=chubbyts_chubbyts-eslint&metric=code_smells)](https://sonarcloud.io/dashboard?id=chubbyts_chubbyts-eslint) +[![duplicated_lines_density](https://sonarcloud.io/api/project_badges/measure?project=chubbyts_chubbyts-eslint&metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=chubbyts_chubbyts-eslint) +[![ncloc](https://sonarcloud.io/api/project_badges/measure?project=chubbyts_chubbyts-eslint&metric=ncloc)](https://sonarcloud.io/dashboard?id=chubbyts_chubbyts-eslint) +[![sqale_rating](https://sonarcloud.io/api/project_badges/measure?project=chubbyts_chubbyts-eslint&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=chubbyts_chubbyts-eslint) +[![alert_status](https://sonarcloud.io/api/project_badges/measure?project=chubbyts_chubbyts-eslint&metric=alert_status)](https://sonarcloud.io/dashboard?id=chubbyts_chubbyts-eslint) +[![reliability_rating](https://sonarcloud.io/api/project_badges/measure?project=chubbyts_chubbyts-eslint&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=chubbyts_chubbyts-eslint) +[![security_rating](https://sonarcloud.io/api/project_badges/measure?project=chubbyts_chubbyts-eslint&metric=security_rating)](https://sonarcloud.io/dashboard?id=chubbyts_chubbyts-eslint) +[![sqale_index](https://sonarcloud.io/api/project_badges/measure?project=chubbyts_chubbyts-eslint&metric=sqale_index)](https://sonarcloud.io/dashboard?id=chubbyts_chubbyts-eslint) +[![vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=chubbyts_chubbyts-eslint&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=chubbyts_chubbyts-eslint) + ## Description ESLint Configuration for chubbyts libraries / framework / projects. @@ -22,7 +34,7 @@ ESLint Configuration for chubbyts libraries / framework / projects. Through [NPM](https://www.npmjs.com) as [@chubbyts/chubbyts-eslint][1]. ```sh -npm i @chubbyts/chubbyts-eslint@^3.0.0 +npm i @chubbyts/chubbyts-eslint@^3.0.1 ``` ## Configuration @@ -47,7 +59,7 @@ Example for a codebase with typescript files in src and tests: #### eslint.config.cjs ```js -module.exports = require('@chubbyts/chubbyts-eslint/eslint.config').default; +module.exports = require('@chubbyts/chubbyts-eslint/dist/eslint.config').default; ``` ### Module @@ -70,7 +82,7 @@ Example for a codebase with typescript files in src and tests: #### eslint.config.mjs ```js -export { default } from '@chubbyts/chubbyts-eslint/eslint.config'; +export { default } from '@chubbyts/chubbyts-eslint/dist/eslint.config'; ``` ## Copyright diff --git a/build.mjs b/build.mjs new file mode 120000 index 0000000..f8b97f5 --- /dev/null +++ b/build.mjs @@ -0,0 +1 @@ +node_modules/@chubbyts/chubbyts-packaging/dist/build.mjs \ No newline at end of file diff --git a/eslintrc.ts b/eslintrc.ts deleted file mode 100644 index d2b340b..0000000 --- a/eslintrc.ts +++ /dev/null @@ -1,47 +0,0 @@ -export default { - env: { - browser: false, - es2021: true, - }, - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - 'plugin:import/recommended', - 'plugin:import/typescript', - ], - overrides: [], - parser: '@typescript-eslint/parser', - parserOptions: { - ecmaVersion: 'latest', - sourceType: 'module', - }, - plugins: ['@typescript-eslint', 'functional'], - rules: { - '@typescript-eslint/no-unused-vars': [ - 'error', - { - argsIgnorePattern: '^_', - destructuredArrayIgnorePattern: '^_', - varsIgnorePattern: '^_', - }, - ], - 'linebreak-style': ['error', 'unix'], - 'no-constant-condition': ['error', { checkLoops: false }], - quotes: ['error', 'single', { avoidEscape: true }], - semi: ['error', 'always'], - '@typescript-eslint/consistent-type-imports': 'error', - 'functional/immutable-data': 'error', - 'functional/no-let': 'error', - 'functional/prefer-tacit': 'error', - 'import/order': 'error', - 'no-param-reassign': 'error', - 'no-var': 'error', - 'prefer-const': 'error', - }, - settings: { - 'import/resolver': { - typescript: true, - node: true, - }, - }, -}; diff --git a/package.json b/package.json index e323aa4..f14d4b7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@chubbyts/chubbyts-eslint", "type": "module", - "version": "3.0.0", + "version": "3.0.1", "description": "ESLint Configuration for chubbyts libraries / framework / projects.", "keywords": [ "chubbyts", @@ -11,12 +11,9 @@ "license": "MIT", "repository": "chubbyts/chubbyts-eslint", "scripts": { - "build:cjs": "tsc --module CommonJS --outDir dist/cjs", - "build:esm": "tsc --module ESNext --outDir dist/esm", - "build:types": "tsc --declaration --emitDeclarationOnly --outDir dist/types", - "build": "rm -Rf dist && npm run build:cjs && npm run build:esm && npm run build:types", - "cs-fix": "prettier --write eslintrc.ts", - "cs": "prettier --check eslintrc.ts", + "build": "node ./build.mjs", + "cs-fix": "prettier --write src", + "cs": "prettier --check src", "prepare": "npm run build" }, "prettier": { @@ -30,16 +27,17 @@ ], "exports": { "./*": { - "types": "./dist/types/*.d.ts", - "require": "./dist/cjs/*.js", - "import": "./dist/esm/*.js", - "default": "./dist/esm/*.js" + "types": "./*.d.ts", + "require": "./*.cjs", + "import": "./*.mjs", + "default": "./*.mjs" } }, "engines": { "node": ">=18" }, "dependencies": { + "@chubbyts/chubbyts-packaging": "^3.0.0-rc.1", "@eslint/js": "^9.17.0", "eslint": "^9.17.0", "eslint-import-resolver-typescript": "^3.7.0", diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..6014226 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,7 @@ +sonar.organization=chubbyts +sonar.projectKey=chubbyts_chubbyts-eslint +sonar.projectName=chubbyts-eslint + +sonar.sources=src +sonar.language=typescript +sonar.sourceEncoding=UTF-8 diff --git a/eslint.config.ts b/src/eslint.config.ts similarity index 100% rename from eslint.config.ts rename to src/eslint.config.ts diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index 2a3651c..0000000 --- a/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "compilerOptions": { - "esModuleInterop": true, - "module": "ESNext", - "moduleResolution": "node", - "outDir": "./dist", - "skipLibCheck": true, - "sourceMap": true, - "strict": true, - "target": "ES2021", - }, - "include": [ - "eslint.config.ts" - ], -} diff --git a/tsconfig.json b/tsconfig.json new file mode 120000 index 0000000..960dc3d --- /dev/null +++ b/tsconfig.json @@ -0,0 +1 @@ +node_modules/@chubbyts/chubbyts-packaging/tsconfig.json \ No newline at end of file