@cookshack/eslint-config 0.1.5 → 1.0.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/.build.yml CHANGED
@@ -1,16 +1,17 @@
1
- image: alpine/edge
1
+ image: alpine/3.20
2
+ packages:
3
+ - nodejs
4
+ - npm
2
5
  secrets:
3
6
  - e2e843cf-6f7e-4b74-989f-819a97ca70b8
7
+ - 693e186a-109b-4e62-9d15-a123679909cc
4
8
  sources:
9
+ - https://git.sr.ht/~mattmundell/build
5
10
  - git+ssh://git@git.sr.ht/~mattmundell/eslint-config
11
+ environment:
12
+ PKG: eslint-config
6
13
  tasks:
7
- - check: |
8
- cd eslint-config
9
- if [ "$(git rev-parse origin/main)" != "$(git rev-parse HEAD)" ]; then \
10
- complete-build; \
11
- fi
12
14
  - mirror: |
13
- cd eslint-config
14
- git remote add github git@github.com:cookshack/eslint-config.git
15
- ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
16
- git push github main
15
+ cd $PKG && ../build/bin/mirror
16
+ - publish: |
17
+ cd $PKG && ../build/bin/publish
package/README.md CHANGED
@@ -1,3 +1,20 @@
1
1
  # @cookshack/eslint-config
2
2
 
3
3
  ESLint config for Cookshack projects.
4
+
5
+ ### Usage
6
+
7
+ ```sh
8
+ npx eslint \
9
+ --no-warn-ignored \
10
+ -f ./node_modules/@cookshack/eslint-config/dist/formatter.js \
11
+ -c ./node_modules/@cookshack/eslint-config/dist/index.js \
12
+ *.js
13
+ ```
14
+
15
+ outputs
16
+
17
+ ```
18
+ /home/name/src/codemirror-ruler/index.js:5:1: More than 1 blank line not allowed. (consecutiveBlank, no-multiple-empty-lines)
19
+ ```
20
+
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ function formatter (results) {
4
+ let str;
5
+
6
+ str = '';
7
+ results.forEach(result => {
8
+ result.messages.forEach(m => {
9
+ str += (result.filePath + ':' + m.line + ':' + m.column + ': ' + m.message + ' (' + m.messageId + ', ' + m.ruleId + ')\n');
10
+ //str += 'test' //result.filePath + '\n'
11
+ //str += '\n'
12
+ });
13
+ });
14
+ return str
15
+ //return 'test'
16
+ //return JSON.stringify(results, null, 2)
17
+ }
18
+
19
+ module.exports = formatter;
@@ -0,0 +1,17 @@
1
+ function formatter (results) {
2
+ let str;
3
+
4
+ str = '';
5
+ results.forEach(result => {
6
+ result.messages.forEach(m => {
7
+ str += (result.filePath + ':' + m.line + ':' + m.column + ': ' + m.message + ' (' + m.messageId + ', ' + m.ruleId + ')\n');
8
+ //str += 'test' //result.filePath + '\n'
9
+ //str += '\n'
10
+ });
11
+ });
12
+ return str
13
+ //return 'test'
14
+ //return JSON.stringify(results, null, 2)
15
+ }
16
+
17
+ export { formatter as default };
package/dist/index.cjs CHANGED
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var globals = require('globals');
4
6
 
5
7
  exports.rules = void 0; exports.languageOptions = void 0; exports.plugins = void 0;
@@ -72,17 +74,24 @@ exports.rules = {
72
74
  'no-var': 'error',
73
75
  'object-curly-spacing': [ 'error', 'always' ],
74
76
  quotes: [ 'error', 'single', { avoidEscape: true } ],
75
- semi: [ 'error', 'never' ],
77
+ semi: [ 'error', 'never' ]
76
78
  //'vars-on-top': [ 'error' ], // want version for let
77
79
  //'newline-before-function-paren': ['error', 'always'],
78
80
  };
79
81
 
80
82
  exports.languageOptions = {
81
83
  globals: {
82
- ...globals.node,
84
+ ...globals.node
83
85
  },
84
86
  parserOptions: {
85
- ecmaVersion: 2022,
86
- sourceType: 'module',
87
- },
87
+ ecmaVersion: 2025,
88
+ sourceType: 'module'
89
+ }
88
90
  };
91
+
92
+ var index = [ { ignores: [ 'TAGS.mjs' ] },
93
+ { languageOptions: exports.languageOptions,
94
+ plugins: exports.plugins,
95
+ rules: exports.rules } ];
96
+
97
+ exports.default = index;
package/dist/index.js CHANGED
@@ -70,19 +70,24 @@ rules = {
70
70
  'no-var': 'error',
71
71
  'object-curly-spacing': [ 'error', 'always' ],
72
72
  quotes: [ 'error', 'single', { avoidEscape: true } ],
73
- semi: [ 'error', 'never' ],
73
+ semi: [ 'error', 'never' ]
74
74
  //'vars-on-top': [ 'error' ], // want version for let
75
75
  //'newline-before-function-paren': ['error', 'always'],
76
76
  };
77
77
 
78
78
  languageOptions = {
79
79
  globals: {
80
- ...globals.node,
80
+ ...globals.node
81
81
  },
82
82
  parserOptions: {
83
- ecmaVersion: 2022,
84
- sourceType: 'module',
85
- },
83
+ ecmaVersion: 2025,
84
+ sourceType: 'module'
85
+ }
86
86
  };
87
87
 
88
- export { languageOptions, plugins, rules };
88
+ var index = [ { ignores: [ 'TAGS.mjs' ] },
89
+ { languageOptions: languageOptions,
90
+ plugins: plugins,
91
+ rules: rules } ];
92
+
93
+ export { index as default, languageOptions, plugins, rules };
package/formatter.js ADDED
@@ -0,0 +1,16 @@
1
+ export default
2
+ function (results) {
3
+ let str
4
+
5
+ str = ''
6
+ results.forEach(result => {
7
+ result.messages.forEach(m => {
8
+ str += (result.filePath + ':' + m.line + ':' + m.column + ': ' + m.message + ' (' + m.messageId + ', ' + m.ruleId + ')\n')
9
+ //str += 'test' //result.filePath + '\n'
10
+ //str += '\n'
11
+ })
12
+ })
13
+ return str
14
+ //return 'test'
15
+ //return JSON.stringify(results, null, 2)
16
+ }
package/index.js CHANGED
@@ -70,17 +70,23 @@ rules = {
70
70
  'no-var': 'error',
71
71
  'object-curly-spacing': [ 'error', 'always' ],
72
72
  quotes: [ 'error', 'single', { avoidEscape: true } ],
73
- semi: [ 'error', 'never' ],
73
+ semi: [ 'error', 'never' ]
74
74
  //'vars-on-top': [ 'error' ], // want version for let
75
75
  //'newline-before-function-paren': ['error', 'always'],
76
76
  }
77
77
 
78
78
  languageOptions = {
79
79
  globals: {
80
- ...globals.node,
80
+ ...globals.node
81
81
  },
82
82
  parserOptions: {
83
- ecmaVersion: 2022,
84
- sourceType: 'module',
85
- },
83
+ ecmaVersion: 2025,
84
+ sourceType: 'module'
85
+ }
86
86
  }
87
+
88
+ export
89
+ default [ { ignores: [ 'TAGS.mjs' ] },
90
+ { languageOptions: languageOptions,
91
+ plugins: plugins,
92
+ rules: rules } ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cookshack/eslint-config",
3
- "version": "0.1.5",
3
+ "version": "1.0.0",
4
4
  "description": "ESLint config for Cookshack projects",
5
5
  "homepage": "https://git.sr.ht/~mattmundell/eslint-config",
6
6
  "type": "module",
@@ -21,6 +21,7 @@
21
21
  "author": "Matt Mundell",
22
22
  "license": "CC0-1.0",
23
23
  "dependencies": {
24
+ "eslint": "9.24",
24
25
  "globals": "^15.10.0"
25
26
  },
26
27
  "devDependencies": {
package/rollup.config.js CHANGED
@@ -1,6 +1,12 @@
1
- export default {
2
- input: 'index.js',
3
- output: [ { file: './dist/index.js', format: 'es' },
4
- { file: './dist/index.cjs', format: 'cjs' } ],
5
- external: [ 'globals' ]
6
- }
1
+ export default [ { input: 'index.js',
2
+ output: [ { file: './dist/index.js',
3
+ format: 'es',
4
+ exports: 'named' }, // silence warning about mixing exports.
5
+ { file: './dist/index.cjs',
6
+ format: 'cjs',
7
+ exports: 'named' } ], // silence warning about mixing exports.
8
+ external: [ 'globals' ] },
9
+ { input: 'formatter.js',
10
+ output: [ { file: './dist/formatter.js', format: 'es' },
11
+ { file: './dist/formatter.cjs', format: 'cjs' } ],
12
+ external: [ 'globals' ] } ]