Skip to content

Commit

Permalink
#318 EsLint Update plus General Actions Update (#319)
Browse files Browse the repository at this point in the history
* #318 EsLint Update plus General Actions Update

* #318 intent issue and dep update

---------

Co-authored-by: Douglas Midgley <[email protected]>
  • Loading branch information
DougMidgley and Douglas Midgley authored Jun 13, 2024
1 parent 88eb0e8 commit 8ca3988
Show file tree
Hide file tree
Showing 12 changed files with 1,697 additions and 561 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

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

This file was deleted.

10 changes: 3 additions & 7 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,15 @@ jobs:
fail-fast: false
matrix:
language: ['javascript']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
16 changes: 10 additions & 6 deletions .github/workflows/prvalidation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,24 @@ jobs:
pr-labeler:
runs-on: ubuntu-latest
steps:
- uses: TimonVS/pr-labeler-action@v4
- uses: TimonVS/pr-labeler-action@v5
with:
configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

test:
runs-on: ubuntu-latest

strategy:
matrix:
node: [18, 20, 22]
name: Run Tests with node ${{ matrix.node }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/
node-version: ${{ matrix.node }}
- run: npm install
- run: npm run lint
- run: npm run test
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "main"
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@v6
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22
registry-url: https://registry.npmjs.org/
- uses: HarmvZ/[email protected]
with:
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"js/ts.implicitProjectConfig.checkJs": true,
"javascript.validate.enable": true
"javascript.validate.enable": true,
"eslint.useESLintClass": true
}
76 changes: 76 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import jsdoc from 'eslint-plugin-jsdoc';
import eslintConfigPrettier from 'eslint-config-prettier';
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
import mochaPlugin from 'eslint-plugin-mocha';
import globals from 'globals';
import js from '@eslint/js';

export default [
js.configs.recommended,
mochaPlugin.configs.flat.recommended,
jsdoc.configs['flat/recommended'],
eslintPluginUnicorn.configs['flat/recommended'],
{
files: ['**/*.js'],
plugins: {
jsdoc,
},
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.node,
...globals.mocha,
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
},
ignores: ['/node_modules/**'],
rules: {
'unicorn/prefer-module': 'off',
'unicorn/numeric-separators-style': 'off',
'jsdoc/check-line-alignment': 2,
'jsdoc/require-jsdoc': [
'warn',
{
require: {
FunctionDeclaration: true,
MethodDefinition: true,
ClassDeclaration: true,
ArrowFunctionExpression: false,
FunctionExpression: true,
},
},
],
'jsdoc/require-param-type': 'error',
'jsdoc/tag-lines': ['warn', 'any', { startLines: 1 }],
'jsdoc/no-undefined-types': 'error',
},

settings: {
jsdoc: {
mode: 'jsdoc',
preferredTypes: {
array: 'Array',
'array.<>': '[]',
'Array.<>': '[]',
'array<>': '[]',
'Array<>': '[]',
Object: 'object',
'object.<>': 'Object.<>',
'object<>': 'Object.<>',
'Object<>': 'Object.<>',
set: 'Set',
'set.<>': 'Set.<>',
'set<>': 'Set.<>',
'Set<>': 'Set.<>',
promise: 'Promise',
'promise.<>': 'Promise.<>',
'promise<>': 'Promise.<>',
'Promise<>': 'Promise.<>',
},
},
},
},
eslintConfigPrettier,
];
Loading

0 comments on commit 8ca3988

Please sign in to comment.