@trenskow/guard 1.0.21 → 1.1.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,46 @@
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
+ 'require-atomic-updates': 'off',
45
+ },
46
+ }];
package/index.js CHANGED
@@ -1,9 +1,6 @@
1
- 'use strict';
1
+ import log from '@trenskow/log';
2
2
 
3
- const
4
- log = require('@trenskow/log');
5
-
6
- exports = module.exports = (application) => {
3
+ export default (application) => {
7
4
  return (condition, message) => {
8
5
  if (!condition) {
9
6
  log('error', application, { message });
package/package.json CHANGED
@@ -1,25 +1,29 @@
1
1
  {
2
- "name": "@trenskow/guard",
3
- "version": "1.0.21",
4
- "description": "A simple guard command.",
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/guard.git"
12
- },
13
- "author": "Kristian Trenskow <trenskow@me.com>",
14
- "license": "BSD-3-Clause",
15
- "bugs": {
16
- "url": "https://github.com/trenskow/guard/issues"
17
- },
18
- "homepage": "https://github.com/trenskow/guard#readme",
19
- "dependencies": {
20
- "@trenskow/log": "^2.0.17"
21
- },
22
- "devDependencies": {
23
- "eslint": "^9.12.0"
24
- }
2
+ "name": "@trenskow/guard",
3
+ "version": "1.1.1",
4
+ "description": "A simple guard command.",
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/guard.git"
13
+ },
14
+ "author": "Kristian Trenskow <trenskow@me.com>",
15
+ "license": "BSD-3-Clause",
16
+ "bugs": {
17
+ "url": "https://github.com/trenskow/guard/issues"
18
+ },
19
+ "homepage": "https://github.com/trenskow/guard#readme",
20
+ "dependencies": {
21
+ "@trenskow/log": "^2.1.0"
22
+ },
23
+ "devDependencies": {
24
+ "@eslint/eslintrc": "^3.1.0",
25
+ "@eslint/js": "^9.13.0",
26
+ "eslint": "^9.13.0",
27
+ "globals": "^15.11.0"
28
+ }
25
29
  }
package/.eslintrc.js DELETED
@@ -1,49 +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
- 'require-atomic-updates': 'off'
48
- }
49
- };