Skip to content

Commit

Permalink
yarn: Upgrade dependencies and change tsconfig management
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjD90 committed Oct 20, 2023
1 parent a5dd7a9 commit 684fe8c
Show file tree
Hide file tree
Showing 19 changed files with 485 additions and 344 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
root = true

[*]
end_of_line = lf
charset = utf-8
insert_final_newline = true
2 changes: 1 addition & 1 deletion .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ parser: '@typescript-eslint/parser'
parserOptions:
tsconfigRootDir: ./
project:
- tsconfig.json
- ./node_modules/@neo9/n9-coding-style/tsconfig-used-by-eslint.json
plugins:
- '@typescript-eslint'
- simple-import-sort
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/node.js.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,21 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Setup yarn
run: npm install -g yarn

- name: Setup Nodejs with yarn caching
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: yarn

- name: Install dependencies
run: yarn --frozen-lockfile

Expand Down
43 changes: 40 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,41 @@
*.swo
*.swp
*.iml
# Logs
logs
*.log
npm-debug.log*

# Dependency directories
node_modules

# Build directory
dist

# Editor's config directories
.vscode
.idea
*.iml

# MacOS related files
*.DS_Store
.AppleDouble
.LSOverride
._*

# Coverage
coverage
.nyc_output

# Windows related files
Thumbs.db
ehthumbs.db
Desktop.ini
$RECYCLE.BIN/

# Optional npm cache directory
.npm
# Optional nvm version file
.nvmrc

# Sonar
.scannerwork
sonar-project.properties
coverage.lcov
4 changes: 0 additions & 4 deletions .husky/commit-msg

This file was deleted.

4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

5 changes: 2 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
Dockerfile
Jenkinsfile
*.txt
.editorconfig

# scripts
*.sh

Expand Down Expand Up @@ -54,6 +56,3 @@ coverage.lcov
# Sonar
.scannerwork
sonar-project.properties

#local conf
*local.ts
8 changes: 4 additions & 4 deletions .release-it.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
"tagAnnotation": "release: V ${version}",
"push": true
},
"kooks": {
"before:init": ["npm run lint", "npm run test"],
"after:release": "npm run post:release"
"hooks": {
"before:init": ["npm run build", "npm run lint", "npm run test"],
"after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
},
"npm": {
"publish": true
},
"github": {
"release": false
"release": true
},
"plugins": {
"@release-it/conventional-changelog": {
Expand Down
67 changes: 41 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,55 +1,70 @@
{
"name": "@neo9/n9-coding-style",
"version": "5.1.2",
"description": "Set of rules ready to use in any JS project, based on eslint",
"keywords": [
"linter",
"eslint",
"node"
],
"license": "GPL-3.0-or-later",
"main": ".eslintrc.yaml",
"license": "MIT",
"scripts": {
"build": "echo 'Nothing to build'",
"format": "prettier --write *.*",
"test:dev": "ava --no-worker-threads --verbose --color --serial --watch",
"test": "ava --no-worker-threads --verbose --serial",
"release": "release-it",
"release:pre-release": "release-it --preRelease",
"release:dry": "release-it --dry-run"
},
"author": {
"name": "Benjamin DANIEL",
"email": "benjamin.daniel@neo9.fr"
},
"repository": {
"type": "git",
"url": "git+https://github.com/neo9/n9-coding-style.git"
},
"homepage": "https://github.com/neo9/n9-coding-style#readme",
"type": "module",
"engines": {
"node": ">=16.20.2"
},
"scripts": {
"format": "prettier --write *.*",
"release": "release-it",
"release:dry": "release-it --dry-run",
"build:changelog": "conventional-changelog -i CHANGELOG.md -s -p jscs -r 0",
"post:release": "echo Successfully released $npm_package_version",
"preversion": "yarn run test",
"prepare": "husky install",
"test": "ava --no-worker-threads --verbose --serial",
"test:dev": "ava --no-worker-threads --verbose --color --serial --watch"
"node": ">= 16.20"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
"eslint": "^8.48.0",
"@typescript-eslint/eslint-plugin": "^6.8.0",
"@typescript-eslint/parser": "^6.8.0",
"eslint": "^8.51.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jsdoc": "^46.5.1",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-jsdoc": "^46.8.2",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-rxjs": "^5.0.3",
"eslint-plugin-simple-import-sort": "^10.0.0"
},
"devDependencies": {
"@commitlint/cli": "^17.7.1",
"@release-it/conventional-changelog": "^7.0.1",
"@types/eslint": "^8.44.2",
"@types/jest": "^29.5.4",
"@types/lodash": "^4.14.197",
"@commitlint/cli": "^18.0.0",
"@release-it/conventional-changelog": "^7.0.2",
"@types/eslint": "^8.44.6",
"@types/jest": "^29.5.6",
"@types/lodash": "^4.14.200",
"ava": "^5.3.1",
"husky": "^8.0.3",
"husky": "^4.3.8",
"lodash": "^4.17.21",
"prettier": "^3.0.3",
"release-it": "^16.1.5",
"release-it": "^16.2.1",
"rxjs": "^7.8.1",
"typescript": "^5.2.2"
},
"peerDependencies": {
"typescript": ">=4.5.0"
"typescript": ">=5.0.0"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "npm run format && npm run lint"
}
}
}
3 changes: 3 additions & 0 deletions test/fixtures/.eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
parser: '@typescript-eslint/parser'
extends:
- ../../.eslintrc.yaml
parserOptions:
project:
- tsconfig.json
6 changes: 3 additions & 3 deletions test/fixtures/utils.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ESLint } from 'eslint';
import path from 'path';
import path from 'node:path';

import { dirname } from 'path';
import { fileURLToPath } from 'url';
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';

const __dirname = dirname(fileURLToPath(import.meta.url));

Expand Down
1 change: 1 addition & 0 deletions test/general-errors.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import test from 'ava';

import Utils from './fixtures/utils.mjs';

test.serial(`load config index.ts in ESLint to validate all rules are correct`, async (t) => {
Expand Down
1 change: 1 addition & 0 deletions test/jsdoc.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import test from 'ava';

import Utils from './fixtures/utils.mjs';

test.serial(`Check JSDoc rules`, async (t) => {
Expand Down
1 change: 1 addition & 0 deletions test/ok.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import test from 'ava';

import Utils from './fixtures/utils.mjs';

test.serial(`load config index.ts in ESLint to validate all rules are correct`, async (t) => {
Expand Down
1 change: 1 addition & 0 deletions test/rxjs.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import test from 'ava';

import Utils from './fixtures/utils.mjs';

test.serial(`Check rxjs rules`, async (t) => {
Expand Down
1 change: 1 addition & 0 deletions test/sort-imports.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import test from 'ava';

import Utils from './fixtures/utils.mjs';

test.serial(`load config index.ts in ESLint to validate all rules are correct`, async (t) => {
Expand Down
20 changes: 20 additions & 0 deletions tsconfig-used-by-eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compileOnSave": true,
"compilerOptions": {
"module": "commonjs",
"target": "es2022",
"outDir": "dist",
"moduleResolution": "node",
"skipLibCheck": true,
"emitDecoratorMetadata": true,
"declaration": true,
"experimentalDecorators": true,
"noImplicitAny": true,
"sourceMap": true,
"lib": ["es2023"],
"strict": false,
"useDefineForClassFields": false
},
"include": ["../../../src", "../../../test"]
}
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compileOnSave": true,
"compilerOptions": {
"module": "commonjs",
Expand Down
Loading

0 comments on commit 684fe8c

Please sign in to comment.