Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update deps #75

Merged
merged 2 commits into from
Oct 29, 2024
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
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

121 changes: 0 additions & 121 deletions .eslintrc

This file was deleted.

89 changes: 84 additions & 5 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,85 @@
name: CI Pipeline
on: [push]
name: NPM Pipeline

on:
workflow_call: {}
push:
branches:
- "*"
tags:
- "v*"

jobs:
legion-npm-pipeline:
uses: meltwater/legion-github-repos/.github/workflows/legion-npm-package.yml@master
secrets: inherit
Test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: "npm"
registry-url: https://registry.npmjs.org
cache-dependency-path: package-lock.json
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_INSTALL_TOKEN }}

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test

Build:
runs-on: ubuntu-latest
needs: Test

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: "npm"
registry-url: https://registry.npmjs.org
cache-dependency-path: package-lock.json
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_INSTALL_TOKEN }}

- name: Install dependencies
run: npm ci

- name: Build package
run: npm run build

Publish:
runs-on: ubuntu-latest
needs: Build
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: "npm"
registry-url: https://registry.npmjs.org
cache-dependency-path: package-lock.json
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

- name: Install dependencies
run: npm ci

- name: Build package
run: npm run build

- name: Publish package
run: npm publish
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/fermium
lts/iron
166 changes: 166 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
import js from '@eslint/js';
import depend from 'eslint-plugin-depend';
import jsdoc from 'eslint-plugin-jsdoc';
import globals from 'globals';

export default [
jsdoc.configs['flat/recommended'],
depend.configs['flat/recommended'],
// http://eslint.org/docs/rules/
{
languageOptions: {
ecmaVersion: 13,
sourceType: 'module',
globals: {
...globals.browser,
...globals.amd,
...globals.jasmine,
...globals.jest,
...globals.es2015,
...globals.node
}
}
},
{
ignores: [
'**/*.test.js',
'**/*.spec.js',
'**/*.config.js'
],
rules: {
...js.configs.recommended.rules,
'default-case': 'error',
'id-length': [
'error',
{
min: 2,
exceptions: ['id']
}
],
'no-alert': 'error',
'no-duplicate-imports': 'error',
'no-implicit-coercion': 'error',
'no-implied-eval': 'error',
'no-invalid-this': 'error',
'no-labels': 'error',
'no-lone-blocks': 'error',
'no-loop-func': 'error',
'no-magic-numbers': [
'error',
{
ignore: [-1, 0, 1, 2]
}
],
'no-param-reassign': 'error',
'no-prototype-builtins': 0,
'no-return-assign': ['error', 'always'],
'no-script-url': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-throw-literal': 'error',
'no-unmodified-loop-condition': 'error',
'no-unused-expressions': 'error',
'no-useless-call': 'error',
'no-useless-concat': 'error',
'no-useless-return': 'error',
'no-void': 'error',
'no-with': 'error',

/**
* Stylistic rules
*/

camelcase: 'error',
'comma-dangle': [
'error',
'never'
],
complexity: 'error',
curly: [
'error',
'all'
],
indent: [
'error',
4, // http://eslint.org/docs/rules/indent
{
SwitchCase: 1
}
],
'max-depth': [
'error',
3 // http://eslint.org/docs/rules/max-depth
],
'new-cap': 'error',
'new-parens': 'error',
'no-continue': 'error',
'no-lonely-if': 'error',
'no-multiple-empty-lines': [
'error',
{
max: 1
}
],
'no-nested-ternary': 'error',
'no-tabs': 'error',
'no-trailing-spaces': [
'error',
{
ignoreComments: true,
skipBlankLines: true
}
],
'no-unneeded-ternary': 'error',
'no-unused-private-class-members': 'off',
'no-unused-vars': ['error', {
'vars': 'all',
'args': 'all',
'argsIgnorePattern': '^__',
'varsIgnorePattern': '^__',
'caughtErrorsIgnorePattern': '^__'
}],
'nonblock-statement-body-position': [
'error',
'beside' // http://eslint.org/docs/rules/nonblock-statement-body-position
],
'one-var-declaration-per-line': [
'error',
'always'
],
quotes: [
'error',
'single'
],
semi: [
'error',
'always'
],
'vars-on-top': 'error',

/**
* Depend Rules
*/
'depend/ban-dependencies': 'warn',

/**
* JSdoc Rules
*/
'jsdoc/require-jsdoc': 'off',
'jsdoc/tag-lines': 'off',

/**
* ES6 Specific
*/

'arrow-body-style': [
'error',
'as-needed'
],
'no-confusing-arrow': 'error',
'no-useless-constructor': 'error',
'no-var': 'error',
'prefer-const': 'error',
'prefer-template': 'error'
}
}
];
Loading