Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .babelrc

This file was deleted.

38 changes: 0 additions & 38 deletions .eslintrc.json

This file was deleted.

12 changes: 12 additions & 0 deletions .github/workflows/node-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: publish to npm

on:
push:
tags:
- 'v*.*.*'

jobs:
node-publish:
uses: fluidware-team/.github/.github/workflows/node-publish.yml@v1
secrets:
npm_token: ${{ secrets.NPM_TOKEN }}
22 changes: 0 additions & 22 deletions .github/workflows/node-release.yml

This file was deleted.

17 changes: 3 additions & 14 deletions .github/workflows/node-test.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
name: lint test
name: lint test compile

on: push

jobs:

test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Use Node.js 18.x
uses: actions/setup-node@v2
with:
node-version: '18'
- run: npm ci
- run: npm run lint
- run: npm test
- run: npm run build
node-lint-test-compile:
uses: fluidware-team/.github/.github/workflows/node-test.yml@v1
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,6 @@ es/
# TernJS port file
.tern-port
xunit.xml

build/
src/version.ts
9 changes: 0 additions & 9 deletions .mocharc.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fund=false
update-notifier=false
save-exact=true
4 changes: 0 additions & 4 deletions .nycrc.json

This file was deleted.

7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"singleQuote": true,
"arrowParens": "avoid",
"printWidth": 120,
"bracketSpacing": true,
"trailingComma": "none"
}
85 changes: 85 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import pluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import nodePlugin from 'eslint-plugin-n';

/** @type {import('eslint').Linter.Config[]} */
export default [
{
name: 'ignore files',
ignores: ['dist/', 'build/', 'reports/', 'node_modules/']
},
{
name: 'include files',
files: ['**/*.{js,mjs,cjs,ts}']
},
{
name: 'globals for node',
files: ['**/*.{mjs,cjs,ts}'],
languageOptions: { globals: globals.node }
},
{
...pluginJs.configs.recommended,
name: 'plugin-js recommended'
},
{
...nodePlugin.configs['flat/recommended-module'],
name: 'custom eslint-plugin-n plugin config',
files: ['**/*.ts'],
rules: {
'n/no-process-env': 'error',
'n/no-missing-import': [
'off', // eslint-plugin-n fails to resolve index.ts files
{
tryExtensions: ['.ts', '.d.ts']
}
]
},
languageOptions: {
globals: {
...globals.node,
NodeJS: true
}
}
},
{
...nodePlugin.configs['flat/recommended-module'],
name: 'custom eslint-plugin-n plugin config for tests',
files: ['tests*/**/*.ts'],
// eslint-plugin-n rules
rules: {
'n/no-process-env': 'off'
},
languageOptions: {
globals: {
...globals.jest
}
}
},
...tseslint.configs.recommended.map(config => ({
...config,
files: ['**/*.ts'],
rules: {
'no-unused-vars': 'off',
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_'
}
]
}
})),
{
// eslint core rules
rules: {
complexity: ['error', 10],
'no-console': 'error',
eqeqeq: ['error', 'smart']
}
},
pluginPrettierRecommended
];
9 changes: 9 additions & 0 deletions jest.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
export default {
preset: 'ts-jest',
testEnvironment: 'node',
collectCoverage: true,
collectCoverageFrom: ['src/**/*.ts'],
coverageDirectory: 'reports/coverage',
coverageReporters: ['text', 'text-summary', 'cobertura']
};
Loading