@trenskow/stack 0.1.18 → 0.2.1

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.
@@ -0,0 +1,51 @@
1
+ import globals from 'globals';
2
+ import path from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import js from '@eslint/js';
5
+ import { FlatCompat } from '@eslint/eslintrc';
6
+
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = path.dirname(__filename);
9
+ const compat = new FlatCompat({
10
+ baseDirectory: __dirname,
11
+ recommendedConfig: js.configs.recommended,
12
+ allConfig: js.configs.all
13
+ });
14
+
15
+ export default [...compat.extends('eslint:recommended'), {
16
+ languageOptions: {
17
+ globals: {
18
+ ...globals.node,
19
+ ...globals.mocha,
20
+ },
21
+
22
+ ecmaVersion: 'latest',
23
+ sourceType: 'module',
24
+ },
25
+
26
+ rules: {
27
+ indent: ['error', 'tab'],
28
+ 'linebreak-style': ['error', 'unix'],
29
+ quotes: ['error', 'single'],
30
+ semi: ['error', 'always'],
31
+
32
+ 'no-console': ['error', {
33
+ allow: ['warn', 'error', 'info'],
34
+ }],
35
+
36
+ 'no-unused-vars': ['error', {
37
+ argsIgnorePattern: '^_',
38
+ }],
39
+
40
+ 'no-empty': ['error', {
41
+ allowEmptyCatch: true,
42
+ }],
43
+
44
+ 'no-trailing-spaces': ['error', {
45
+ ignoreComments: true,
46
+ }],
47
+
48
+ 'require-atomic-updates': 'off',
49
+ 'eol-last': ['error', 'always'],
50
+ },
51
+ }];
package/index.js CHANGED
@@ -1,6 +1,4 @@
1
- 'use strict';
2
-
3
- exports = module.exports = (stack) => {
1
+ export default (stack) => {
4
2
  return (stack || (new Error()).stack)
5
3
  .split('\n')
6
4
  .map(line => line.trim())
package/package.json CHANGED
@@ -1,30 +1,34 @@
1
1
  {
2
- "name": "@trenskow/stack",
3
- "version": "0.1.18",
4
- "description": "Get the current stack trace as an array (V8 only).",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/trenskow/stack.git"
12
- },
13
- "keywords": [
14
- "stack",
15
- "trace",
16
- "stacktrace",
17
- "parsed",
18
- "array",
19
- "v8"
20
- ],
21
- "author": "Kristian Trenskow <trenskow@me.com>",
22
- "license": "BSD-2-Clause",
23
- "bugs": {
24
- "url": "https://github.com/trenskow/stack/issues"
25
- },
26
- "homepage": "https://github.com/trenskow/stack#readme",
27
- "devDependencies": {
28
- "eslint": "^9.12.0"
29
- }
2
+ "name": "@trenskow/stack",
3
+ "version": "0.2.1",
4
+ "description": "Get the current stack trace as an array (V8 only).",
5
+ "main": "index.js",
6
+ "type": "module",
7
+ "scripts": {
8
+ "test": "echo \"Error: no test specified\" && exit 1"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/trenskow/stack.git"
13
+ },
14
+ "keywords": [
15
+ "stack",
16
+ "trace",
17
+ "stacktrace",
18
+ "parsed",
19
+ "array",
20
+ "v8"
21
+ ],
22
+ "author": "Kristian Trenskow <trenskow@me.com>",
23
+ "license": "BSD-2-Clause",
24
+ "bugs": {
25
+ "url": "https://github.com/trenskow/stack/issues"
26
+ },
27
+ "homepage": "https://github.com/trenskow/stack#readme",
28
+ "devDependencies": {
29
+ "@eslint/eslintrc": "^3.2.0",
30
+ "@eslint/js": "^9.13.0",
31
+ "eslint": "^9.16.0",
32
+ "globals": "^15.13.0"
33
+ }
30
34
  }
package/.eslintrc.js DELETED
@@ -1,58 +0,0 @@
1
- module.exports = {
2
- 'env': {
3
- 'es6': true,
4
- 'node': true,
5
- 'mocha': true
6
- },
7
- 'parserOptions': {
8
- 'ecmaVersion': 2017
9
- },
10
- 'extends': 'eslint:recommended',
11
- 'rules': {
12
- 'indent': [
13
- 'error',
14
- 'tab'
15
- ],
16
- 'linebreak-style': [
17
- 'error',
18
- 'unix'
19
- ],
20
- 'quotes': [
21
- 'error',
22
- 'single'
23
- ],
24
- 'semi': [
25
- 'error',
26
- 'always'
27
- ],
28
- 'no-console': [
29
- 'error', {
30
- 'allow': [
31
- 'warn',
32
- 'error',
33
- 'info'
34
- ]
35
- }
36
- ],
37
- 'no-unused-vars': [
38
- 'error', {
39
- 'argsIgnorePattern': '^_'
40
- }
41
- ],
42
- 'no-empty': [
43
- 'error', {
44
- 'allowEmptyCatch': true
45
- }
46
- ],
47
- 'no-trailing-spaces': [
48
- 'error', {
49
- 'ignoreComments': true
50
- }
51
- ],
52
- 'require-atomic-updates': 'off',
53
- 'eol-last': [
54
- 'error',
55
- 'always'
56
- ]
57
- }
58
- };