Skip to content

Commit

Permalink
Eslint (#552)
Browse files Browse the repository at this point in the history
* eslint part 1

* eslint

* bump required node version

* bump required node version

* fix(CodeQL): Patch warnings
  • Loading branch information
Kathund authored Jun 7, 2024
1 parent 5436ac8 commit 2b1f8fb
Show file tree
Hide file tree
Showing 128 changed files with 2,542 additions and 2,954 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# This CI Workflow was deployed and configured by WarpWing and Nate.
name: CI/CD (16.x)
name: CI/CD (20.x)

on:
push:
pull_request:
workflow_dispatch:

env:
NODE_VERSION: '16.x'
NODE_VERSION: '20.x'

jobs:
es-lint:
Expand Down
5 changes: 3 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ config.gypi
CVS
npm-debug.log
.eslintignore
.eslintrc.json
.eslintrc.
testing/
.github
.travis.yml
Expand All @@ -23,4 +23,5 @@ tests/
typings/*.json
master.json
.env
dtslint.json
dtslint.json
.eslintcache
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#### Requirements

**For Node.js users >= v14.x.x** <br> **For TypeScript users >= v3.5**
**For Node.js users >= v18.18.0** <br> **For TypeScript users >= v3.5**

### Installation & Usage

Expand Down
71 changes: 71 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import jsdoc from 'eslint-plugin-jsdoc';
import globals from 'globals';
import js from '@eslint/js';

export default [
js.configs.recommended,
{
ignores: ['docs/**', 'tests/**', 'node_modules/*'],
plugins: { jsdoc: jsdoc },
languageOptions: {
ecmaVersion: 2021,
sourceType: 'commonjs',
globals: {
...globals.commonjs,
...globals.es2021,
...globals.node
}
},
rules: {
'max-len': ['error', { code: 120, ignoreUrls: true, ignoreComments: true }],
'no-constant-condition': ['error', { checkLoops: false }],
'prefer-const': ['warn', { destructuring: 'all' }],
'no-unused-vars': ['error', { args: 'none' }],
curly: ['warn', 'multi-line', 'consistent'],
'logical-assignment-operators': 'warn',
'no-template-curly-in-string': 'error',
'quote-props': ['error', 'as-needed'],
'jsdoc/no-undefined-types': 'warn',
'comma-dangle': ['error', 'never'],
'no-useless-constructor': 'error',
'no-useless-assignment': 'error',
'no-inner-declarations': 'error',
'no-implicit-coercion': 'error',
'jsdoc/require-jsdoc': 'error',
'no-use-before-define': 'warn',
'no-underscore-dangle': 'warn',
'no-unneeded-ternary': 'error',
'jsdoc/check-values': 'error',
'default-param-last': 'error',
'one-var': ['warn', 'never'],
'no-inline-comments': 'warn',
'jsdoc/valid-types': 'error',
'no-empty-function': 'error',
'no-useless-return': 'error',
'no-useless-rename': 'warn',
'no-useless-concat': 'warn',
'no-throw-literal': 'error',
'no-extend-native': 'error',
'default-case-last': 'warn',
'no-self-compare': 'error',
'no-new-wrappers': 'error',
'no-lone-blocks': 'error',
'no-undef-init': 'error',
'no-else-return': 'warn',
'no-extra-semi': 'error',
'require-await': 'warn',
yoda: ['error', 'always'],
'default-case': 'error',
'dot-notation': 'error',
'no-sequences': 'warn',
'no-multi-str': 'warn',
'no-lonely-if': 'warn',
'no-new-func': 'error',
'no-console': 'error',
camelcase: 'warn',
'no-var': 'warn',
eqeqeq: 'warn',
semi: 'error'
}
}
];
Loading

0 comments on commit 2b1f8fb

Please sign in to comment.