Skip to content

Commit

Permalink
feat!: fully separate mocha config + add types
Browse files Browse the repository at this point in the history
  • Loading branch information
voxpelli committed Jun 3, 2023
1 parent 7121ad0 commit bfc1b87
Show file tree
Hide file tree
Showing 9 changed files with 277 additions and 17 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
/node_modules
/yarn.lock

# Generated types
*.d.ts
*.d.ts.map

# Library specific ones
/.cache-eslint-remote-tester
/eslint-remote-tester-results
5 changes: 4 additions & 1 deletion base-configs/standard.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

// Copied to avoid having to downgrade eslin-plugin-n because of https://github.com/standard/eslint-config-standard/pull/271

module.exports = {
/** @satisfies {import('eslint').ESLint.ConfigData} */
const config = {
'parserOptions': {
'ecmaVersion': 2022,
'ecmaFeatures': {
Expand Down Expand Up @@ -246,3 +247,5 @@ module.exports = {
'promise/param-names': 'error',
},
};

module.exports = config;
10 changes: 10 additions & 0 deletions declaration.tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

{
"extends": "./tsconfig",
"compilerOptions": {
"declaration": true,
"declarationMap": true,
"noEmit": false,
"emitDeclarationOnly": true
}
}
5 changes: 4 additions & 1 deletion esm.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

module.exports = {
/** @satisfies {import('eslint').ESLint.ConfigData} */
const config = {
'extends': [
'./',
],
Expand All @@ -11,3 +12,5 @@ module.exports = {
'unicorn/prefer-module': 'error',
},
};

module.exports = config;
9 changes: 4 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict';

module.exports = {
/** @satisfies {import('eslint').ESLint.ConfigData} */
const config = {
plugins: [
'es-x',
'import',
'jsdoc',
'mocha',
'promise',
'security',
'sort-destructure-keys',
Expand All @@ -15,7 +15,6 @@ module.exports = {
'./base-configs/standard',
'plugin:n/recommended',
'plugin:security/recommended',
'plugin:mocha/recommended',
'plugin:unicorn/recommended',
'plugin:promise/recommended',
'plugin:jsdoc/recommended',
Expand Down Expand Up @@ -73,8 +72,6 @@ module.exports = {
'jsdoc/tag-lines': ['warn', 'never', { 'startLines': 1 }],
'jsdoc/valid-types': 'off',

'mocha/no-mocha-arrows': 'off',

'n/no-process-exit': 'off',

'security/detect-object-injection': 'off',
Expand Down Expand Up @@ -115,3 +112,5 @@ module.exports = {
'sort-destructure-keys/sort-destructure-keys': 'error',
},
};

module.exports = config;
16 changes: 12 additions & 4 deletions mocha.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
'use strict';

module.exports = {
'env': {
/** @satisfies {import('eslint').ESLint.ConfigData} */
const config = {
plugins: ['mocha'],
env: {
'mocha': true,
},
'rules': {
'no-unused-expressions': 0,
'extends': [
'plugin:mocha/recommended',
],
rules: {
'mocha/no-mocha-arrows': 'off',
'no-unused-expressions': 'off',
},
};

module.exports = config;
213 changes: 209 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bfc1b87

Please sign in to comment.