c3b-lint 0.0.4 → 0.0.5

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/README.md CHANGED
@@ -29,6 +29,10 @@ markdown that a tool can check, with one command and one config to install. It r
29
29
 
30
30
  Formatting itself (indent, quotes, spacing) is not linted: the `.editorconfig` and the IDE own it.
31
31
 
32
+ A Node library that keeps its modules in `src/` (c10g) is not a site: its `eslint.config.js` is
33
+ `export default [...base, librarySrc];` (both from `c3b-lint/config/eslint.config.js`), which lints `src/` with the
34
+ Node rules, and the site-layout checks only apply when `src/` holds pages.
35
+
32
36
  ## Setup
33
37
 
34
38
  ```
@@ -77,6 +77,22 @@ export const node = {
77
77
  },
78
78
  };
79
79
 
80
+ // For a Node library that keeps its modules in src/ (c10g): the Node rules there instead of the
81
+ // browser ones, which are switched off because ESLint merges every matching object's rules.
82
+ // Usage, in the project's eslint.config.js: `export default [...base, librarySrc];`
83
+ export const librarySrc = {
84
+ ...node,
85
+ files: ['src/**/*.js'],
86
+ ignores: [],
87
+ rules: {
88
+ ...node.rules,
89
+ 'no-console': 'off',
90
+ 'no-restricted-syntax': 'off',
91
+ 'no-restricted-properties': 'off',
92
+ 'no-restricted-globals': 'off',
93
+ },
94
+ };
95
+
80
96
  export default [
81
97
  { ignores: ['node_modules/**', 'dist/**', 'c10g/**', 'src/**/vendor/**', '**/*.min.js'] },
82
98
  browser,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c3b-lint",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "Lints a co:lab project against the rules a tool can check: ESLint, Stylelint, the 500-line limit and the shared .editorconfig; --init writes the config files.",
5
5
  "license": "GPL-3.0",
6
6
  "type": "module",