eslint-config-uphold 6.3.1 → 6.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-uphold",
3
- "version": "6.3.1",
3
+ "version": "6.4.0",
4
4
  "description": "Uphold-flavored ESLint config",
5
5
  "keywords": [
6
6
  "config",
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "license": "MIT",
16
16
  "author": "Uphold",
17
- "main": "src",
17
+ "main": "./src/index.js",
18
18
  "repository": {
19
19
  "type": "git",
20
20
  "url": "git+ssh://git@github.com/uphold/eslint-config-uphold.git"
@@ -26,9 +26,9 @@
26
26
  "access": "public"
27
27
  },
28
28
  "scripts": {
29
- "lint": "eslint src test/index.js",
29
+ "lint": "eslint",
30
30
  "release": "release-it",
31
- "test": "mocha $npm_package_options_mocha"
31
+ "test": "node --test 'test/index.test.js'"
32
32
  },
33
33
  "dependencies": {
34
34
  "@babel/core": "^7.26.10",
@@ -52,10 +52,8 @@
52
52
  "@types/eslint": "^9.6.1",
53
53
  "@uphold/github-changelog-generator": "^4.0.2",
54
54
  "eslint": "^9.23.0",
55
- "mocha": "^11.1.0",
56
55
  "prettier": "^3.5.3",
57
- "release-it": "^18.1.2",
58
- "should": "^13.2.3"
56
+ "release-it": "^18.1.2"
59
57
  },
60
58
  "peerDependencies": {
61
59
  "eslint": "~9.23.0",
@@ -72,7 +70,5 @@
72
70
  "engines": {
73
71
  "node": "^20.19.0 || ^22.12.0"
74
72
  },
75
- "options": {
76
- "mocha": "-t 10000 --require should test"
77
- }
73
+ "type": "module"
78
74
  }
package/src/index.js CHANGED
@@ -1,26 +1,24 @@
1
- 'use strict';
2
-
3
1
  /**
4
2
  * Module dependencies.
5
3
  *
6
4
  * @typedef {import('eslint').Linter.Config} LinterConfig
7
5
  */
8
6
 
9
- const { defineConfig } = require('eslint/config');
10
- const babelParser = require('@babel/eslint-parser');
11
- const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended');
12
- const globals = require('globals');
13
- const js = require('@eslint/js');
14
- const jsdoc = require('eslint-plugin-jsdoc');
15
- const mocha = require('eslint-plugin-mocha');
16
- const nodePlugin = require('eslint-plugin-n');
17
- const promise = require('eslint-plugin-promise');
18
- const rules = require('./rules');
19
- const sortDestructureKeys = require('eslint-plugin-sort-destructure-keys');
20
- const sortImportsRequires = require('eslint-plugin-sort-imports-requires');
21
- const sortKeysFix = require('eslint-plugin-sort-keys-fix');
22
- const sqlTemplate = require('eslint-plugin-sql-template');
23
- const stylistic = require('@stylistic/eslint-plugin-js');
7
+ import { defineConfig } from 'eslint/config';
8
+ import babelParser from '@babel/eslint-parser';
9
+ import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
10
+ import globals from 'globals';
11
+ import js from '@eslint/js';
12
+ import jsdoc from 'eslint-plugin-jsdoc';
13
+ import mocha from 'eslint-plugin-mocha';
14
+ import nodePlugin from 'eslint-plugin-n';
15
+ import promise from 'eslint-plugin-promise';
16
+ import rules from './rules/index.js';
17
+ import sortDestructureKeys from 'eslint-plugin-sort-destructure-keys';
18
+ import sortImportsRequires from 'eslint-plugin-sort-imports-requires';
19
+ import sortKeysFix from 'eslint-plugin-sort-keys-fix';
20
+ import sqlTemplate from 'eslint-plugin-sql-template';
21
+ import stylistic from '@stylistic/eslint-plugin-js';
24
22
 
25
23
  /**
26
24
  * Language options.
@@ -39,7 +37,8 @@ const languageOptions = {
39
37
  parser: babelParser,
40
38
  parserOptions: {
41
39
  requireConfigFile: false
42
- }
40
+ },
41
+ sourceType: 'module'
43
42
  };
44
43
 
45
44
  /**
@@ -50,7 +49,11 @@ const languageOptions = {
50
49
 
51
50
  const upholdBaseConfig = defineConfig([
52
51
  {
53
- extends: [js.configs.recommended, jsdoc.configs['flat/recommended-error'], eslintPluginPrettierRecommended],
52
+ extends: [
53
+ { ...js.configs.recommended, name: 'eslint/recommended' },
54
+ jsdoc.configs['flat/recommended-error'],
55
+ eslintPluginPrettierRecommended
56
+ ],
54
57
  languageOptions,
55
58
  name: 'uphold/base',
56
59
  plugins: {
@@ -85,7 +88,12 @@ const upholdBaseConfig = defineConfig([
85
88
  }
86
89
  ],
87
90
  'jsdoc/no-defaults': 0,
88
- 'jsdoc/require-description-complete-sentence': 'error',
91
+ 'jsdoc/require-description-complete-sentence': [
92
+ 'error',
93
+ {
94
+ abbreviations: ['e.g.', 'i.e.', 'etc.']
95
+ }
96
+ ],
89
97
  'jsdoc/require-jsdoc': 0,
90
98
  'jsdoc/tag-lines': 0,
91
99
  'max-depth': 'error',
@@ -239,15 +247,23 @@ const upholdBinScriptsConfig = {
239
247
  };
240
248
 
241
249
  /**
242
- * Export `uphold` shared configuration preset.
250
+ * `uphold` shared configuration preset.
243
251
  *
244
252
  * @type {LinterConfig[]}
245
253
  */
246
254
 
247
- module.exports = defineConfig([
255
+ const uphold = defineConfig([
248
256
  {
249
257
  extends: [upholdBaseConfig, upholdBinScriptsConfig],
250
- languageOptions,
251
258
  name: 'uphold/default'
252
259
  }
253
260
  ]);
261
+
262
+ /**
263
+ * Export the configuration.
264
+ *
265
+ * @see https://nodejs.org/docs/latest-v22.x/api/modules.html#loading-ecmascript-modules-using-require
266
+ */
267
+
268
+ export { uphold as 'module.exports' };
269
+ export default uphold;
@@ -1,13 +1,11 @@
1
- 'use strict';
2
-
3
1
  /**
4
- * Export `explicit-sinon-use-fake-timers` rule.
2
+ * `explicit-sinon-use-fake-timers` rule.
5
3
  * - Validates that `sinon.useFakeTimers()` is always called with an explicit `toFake` property.
6
4
  *
7
5
  * @type {import('eslint').Rule.RuleModule}
8
6
  */
9
7
 
10
- module.exports = {
8
+ const explicitSinonUseFakeTimers = {
11
9
  create(context) {
12
10
  return {
13
11
  CallExpression(node) {
@@ -53,3 +51,9 @@ module.exports = {
53
51
  type: 'problem'
54
52
  }
55
53
  };
54
+
55
+ /**
56
+ * Export `explicit-sinon-use-fake-timers` rule.
57
+ */
58
+
59
+ export default explicitSinonUseFakeTimers;
@@ -1,11 +1,11 @@
1
- 'use strict';
2
-
3
1
  /**
4
2
  * Export `rules`.
5
3
  *
6
4
  * @type {Record<string, import('eslint').Rule.RuleModule>}
7
5
  */
8
6
 
9
- module.exports = {
10
- 'explicit-sinon-use-fake-timers': require('./explicit-sinon-use-fake-timers.js')
7
+ import explicitSinonUseFakeTimers from './explicit-sinon-use-fake-timers.js';
8
+
9
+ export default {
10
+ 'explicit-sinon-use-fake-timers': explicitSinonUseFakeTimers
11
11
  };