@jeffcaradona/eslint-plugin-eta 0.2.3 → 0.3.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/LICENSE CHANGED
@@ -1,7 +1,7 @@
1
- Copyright 2025 Jeff Caradona <jeffcaradona@gmail.com>
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
-
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
-
1
+ Copyright 2025 Jeff Caradona <jeffcaradona@gmail.com>
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
7
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,31 +1,101 @@
1
- # eslint-plugin-eta
2
- An ESLint plugin so you can lint Eta template files (forked from <https://github.com/bgub/eslint-plugin-eta>) with so much assistance from GitHub Copilot.
3
-
4
- <span align="center">
5
-
6
-
7
-
8
- </span>
9
-
10
- > Lint your embeddable Eta templates with ease
11
-
12
-
13
-
14
- ### Installation
15
- Run `npm install --save-dev @jeffcaradona/eslint-plugin-eta` to install this ESLint plugin.
16
-
17
- ### Usage
18
- Add this to your `eslint.config.js`:
19
- ```javascript
20
- import eta from '@jeffcaradona/eslint-plugin-eta'
21
-
22
- export default [
23
- {
24
- files: ['**/*.eta'],
25
- plugins: {
26
- eta
27
- },
28
- processor: 'eta/eta'
29
- }
30
- ]
31
- ```
1
+ # eslint-plugin-eta
2
+ An ESLint plugin so you can lint Eta template files (forked from <https://github.com/bgub/eslint-plugin-eta>) with so much assistance from GitHub Copilot.
3
+
4
+ <span align="center">
5
+
6
+
7
+ </span>
8
+
9
+ > Lint your embeddable Eta templates with ease
10
+
11
+ ## Supported Environments
12
+
13
+ ### Node.js Versions
14
+ - **Minimum**: Node.js 18.18.0 (required by ESLint 9)
15
+ - **Tested**: Node.js 18.18.0, 20.x, 24.x (current LTS)
16
+
17
+ ### ESLint Versions
18
+ - **Minimum**: ESLint 9.x
19
+ - **Note**: ESLint 9 requires flat config format
20
+
21
+ ### Eta Versions
22
+ - **Supported**: Eta v1.x, v2.x, v3.x, v4.x
23
+ - **Tested**: All versions in the peer dependency range
24
+
25
+ ### Module Formats
26
+ - **ESM (ES Modules)**: ✅ Fully supported
27
+ - **CommonJS (CJS)**: ⚠️ See note below
28
+
29
+ > **Note**: CommonJS support is planned for v0.3.0. Currently, this plugin is ESM-only. If you need CommonJS support, please pin to a release that includes dual-module support, or use ESM in your project.
30
+
31
+ ### Installation
32
+ Run `npm install --save-dev @jeffcaradona/eslint-plugin-eta` to install this ESLint plugin.
33
+
34
+ ### Usage
35
+
36
+ #### ESM (Recommended)
37
+ Add this to your `eslint.config.js`:
38
+ ```javascript
39
+ import eta from '@jeffcaradona/eslint-plugin-eta'
40
+
41
+ export default [
42
+ {
43
+ files: ['**/*.eta'],
44
+ plugins: {
45
+ eta
46
+ },
47
+ processor: 'eta/eta'
48
+ }
49
+ ]
50
+ ```
51
+
52
+ #### CommonJS (v0.3.0+)
53
+ > Available in v0.3.0 and later
54
+
55
+ Add this to your `eslint.config.cjs`:
56
+ ```javascript
57
+ const eta = require('@jeffcaradona/eslint-plugin-eta')
58
+
59
+ module.exports = [
60
+ {
61
+ files: ['**/*.eta'],
62
+ plugins: {
63
+ eta
64
+ },
65
+ processor: 'eta/eta'
66
+ }
67
+ ]
68
+ ```
69
+
70
+ ## Compatibility Matrix
71
+
72
+ | Node Version | ESLint 9 | Eta v1-v4 |
73
+ |--------------|----------|-----------|
74
+ | 18.18.0 | ✅ | ✅ |
75
+ | 20.x | ✅ | ✅ |
76
+ | 24.x | ✅ | ✅ |
77
+
78
+ ## Troubleshooting
79
+
80
+ ### Error: "Cannot find module" or "ERR_REQUIRE_ESM"
81
+
82
+ If you're getting module resolution errors:
83
+
84
+ 1. **Ensure ESLint 9.x is installed**: `npm list eslint`
85
+ 2. **Check Node.js version**: Must be 18.18.0 or higher
86
+ 3. **Use flat config**: ESLint 9 requires `eslint.config.js` (not `.eslintrc.js`)
87
+
88
+ ### Tests Failing
89
+
90
+ Run the full test suite to verify compatibility:
91
+ ```bash
92
+ npm run test:prod
93
+ ```
94
+
95
+ Test output includes linting, coverage, and all integration tests.
96
+
97
+ ## Contributing
98
+
99
+ See [CHANGELOG.md](CHANGELOG.md) for version history and planned features.
100
+
101
+ For development setup, see the [documentation](documentation/) folder.
package/dist/index.cjs ADDED
@@ -0,0 +1,53 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // lib/index.js
20
+ var index_exports = {};
21
+ __export(index_exports, {
22
+ default: () => index_default
23
+ });
24
+ module.exports = __toCommonJS(index_exports);
25
+
26
+ // lib/processors/eta.js
27
+ var import_eta = require("eta");
28
+ var eta_default = {
29
+ preprocess: (text, _filename) => {
30
+ const eta = new import_eta.Eta({
31
+ parse: {
32
+ exec: "",
33
+ interpolate: "=",
34
+ raw: "~"
35
+ },
36
+ tags: ["<%", "%>"]
37
+ });
38
+ let result = eta.parse(text);
39
+ const text_content = result.filter((res) => res.t === "r" || res.t === "i" || res.t === "e").map((res) => String(res.val)).join("\n");
40
+ return [{ text: text_content, filename: _filename }];
41
+ },
42
+ postprocess: (messages, _filename) => {
43
+ return messages.flat();
44
+ }
45
+ };
46
+
47
+ // lib/index.js
48
+ var index_default = {
49
+ processors: {
50
+ eta: eta_default
51
+ }
52
+ };
53
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../lib/index.js","../lib/processors/eta.js"],"sourcesContent":["import eta from './processors/eta.js'\n\nexport default {\n processors: {\n eta: eta\n }\n}\n","import { Eta } from 'eta'\n\nexport default {\n preprocess: (text, _filename) => {\n const eta = new Eta({\n parse: {\n exec: '',\n interpolate: '=',\n raw: '~'\n },\n tags: ['<%', '%>']\n })\n let result = eta.parse(text)\n\n const text_content = result\n .filter((res) => res.t === 'r' || res.t === 'i' || res.t === 'e')\n .map((res) => String(res.val))\n .join('\\n')\n\n return [{ text: text_content, filename: _filename }]\n },\n\n postprocess: (messages, _filename) => {\n return messages.flat()\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,iBAAoB;AAEpB,IAAO,cAAQ;AAAA,EACb,YAAY,CAAC,MAAM,cAAc;AAC/B,UAAM,MAAM,IAAI,eAAI;AAAA,MAClB,OAAO;AAAA,QACL,MAAM;AAAA,QACN,aAAa;AAAA,QACb,KAAK;AAAA,MACP;AAAA,MACA,MAAM,CAAC,MAAM,IAAI;AAAA,IACnB,CAAC;AACD,QAAI,SAAS,IAAI,MAAM,IAAI;AAE3B,UAAM,eAAe,OAClB,OAAO,CAAC,QAAQ,IAAI,MAAM,OAAO,IAAI,MAAM,OAAO,IAAI,MAAM,GAAG,EAC/D,IAAI,CAAC,QAAQ,OAAO,IAAI,GAAG,CAAC,EAC5B,KAAK,IAAI;AAEZ,WAAO,CAAC,EAAE,MAAM,cAAc,UAAU,UAAU,CAAC;AAAA,EACrD;AAAA,EAEA,aAAa,CAAC,UAAU,cAAc;AACpC,WAAO,SAAS,KAAK;AAAA,EACvB;AACF;;;ADvBA,IAAO,gBAAQ;AAAA,EACb,YAAY;AAAA,IACV,KAAK;AAAA,EACP;AACF;","names":[]}
package/dist/index.js ADDED
@@ -0,0 +1,31 @@
1
+ // lib/processors/eta.js
2
+ import { Eta } from "eta";
3
+ var eta_default = {
4
+ preprocess: (text, _filename) => {
5
+ const eta = new Eta({
6
+ parse: {
7
+ exec: "",
8
+ interpolate: "=",
9
+ raw: "~"
10
+ },
11
+ tags: ["<%", "%>"]
12
+ });
13
+ let result = eta.parse(text);
14
+ const text_content = result.filter((res) => res.t === "r" || res.t === "i" || res.t === "e").map((res) => String(res.val)).join("\n");
15
+ return [{ text: text_content, filename: _filename }];
16
+ },
17
+ postprocess: (messages, _filename) => {
18
+ return messages.flat();
19
+ }
20
+ };
21
+
22
+ // lib/index.js
23
+ var index_default = {
24
+ processors: {
25
+ eta: eta_default
26
+ }
27
+ };
28
+ export {
29
+ index_default as default
30
+ };
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../lib/processors/eta.js","../lib/index.js"],"sourcesContent":["import { Eta } from 'eta'\n\nexport default {\n preprocess: (text, _filename) => {\n const eta = new Eta({\n parse: {\n exec: '',\n interpolate: '=',\n raw: '~'\n },\n tags: ['<%', '%>']\n })\n let result = eta.parse(text)\n\n const text_content = result\n .filter((res) => res.t === 'r' || res.t === 'i' || res.t === 'e')\n .map((res) => String(res.val))\n .join('\\n')\n\n return [{ text: text_content, filename: _filename }]\n },\n\n postprocess: (messages, _filename) => {\n return messages.flat()\n }\n}\n","import eta from './processors/eta.js'\n\nexport default {\n processors: {\n eta: eta\n }\n}\n"],"mappings":";AAAA,SAAS,WAAW;AAEpB,IAAO,cAAQ;AAAA,EACb,YAAY,CAAC,MAAM,cAAc;AAC/B,UAAM,MAAM,IAAI,IAAI;AAAA,MAClB,OAAO;AAAA,QACL,MAAM;AAAA,QACN,aAAa;AAAA,QACb,KAAK;AAAA,MACP;AAAA,MACA,MAAM,CAAC,MAAM,IAAI;AAAA,IACnB,CAAC;AACD,QAAI,SAAS,IAAI,MAAM,IAAI;AAE3B,UAAM,eAAe,OAClB,OAAO,CAAC,QAAQ,IAAI,MAAM,OAAO,IAAI,MAAM,OAAO,IAAI,MAAM,GAAG,EAC/D,IAAI,CAAC,QAAQ,OAAO,IAAI,GAAG,CAAC,EAC5B,KAAK,IAAI;AAEZ,WAAO,CAAC,EAAE,MAAM,cAAc,UAAU,UAAU,CAAC;AAAA,EACrD;AAAA,EAEA,aAAa,CAAC,UAAU,cAAc;AACpC,WAAO,SAAS,KAAK;AAAA,EACvB;AACF;;;ACvBA,IAAO,gBAAQ;AAAA,EACb,YAAY;AAAA,IACV,KAAK;AAAA,EACP;AACF;","names":[]}
package/package.json CHANGED
@@ -1,63 +1,76 @@
1
- {
2
- "name": "@jeffcaradona/eslint-plugin-eta",
3
- "version": "0.2.3",
4
- "description": "An ESLint plugin so you can lint Eta template files (forked from bgub/eslint-plugin-eta)",
5
- "type": "module",
6
- "main": "lib/index.js",
7
- "scripts": {
8
- "test": "jest --coverage",
9
- "test:prod": "npm run lint && npm run test -- --no-cache",
10
- "test:watch": "jest --coverage --watch",
11
- "format": "prettier --write lib/**/*.js test/**/*.js",
12
- "lint": "eslint lib/**/*.js test/**/*.js --ext .js",
13
- "report-coverage": "cat ./coverage/lcov.info | coveralls"
14
- },
15
- "keywords": [
16
- "eslint",
17
- "eslintplugin"
18
- ],
19
- "author": "jeffcaradona <jeffcaradona@gmail.com>",
20
- "contributors": [
21
- "Ben Gubler (Original Author)"
22
- ],
23
- "license": "MIT",
24
- "repository": {
25
- "type": "git",
26
- "url": "git+https://github.com/jeffcaradona/eslint-plugin-eta.git"
27
-
28
- },
29
- "peerDependencies": {
30
- "eslint": ">=9 <10",
31
- "eta": ">=1.0.0 <5.0.0"
32
- },
33
- "devDependencies": {
34
- "@babel/preset-env": "^7.28.5",
35
- "@eslint/compat": "^2.0.0",
36
- "@istanbuljs/load-nyc-config": "^1.1.0",
37
- "@typescript-eslint/eslint-plugin": "^8.50.0",
38
- "@typescript-eslint/parser": "^8.50.0",
39
- "babel-jest": "^30.2.0",
40
- "eslint": "^9.39.2",
41
- "eslint-plugin-import": "^2.32.0",
42
- "eslint-plugin-node": "^11.1.0",
43
- "eslint-plugin-promise": "^7.2.1",
44
- "eta": "^4.5.0",
45
- "jest": "^30.2.0",
46
- "prettier": "^3.7.4",
47
- "typescript": "^5.9.3"
48
- },
49
- "jest": {
50
- "testEnvironment": "node",
51
- "transform": {
52
- "^.+\\.jsx?$": "babel-jest"
53
- },
54
- "collectCoverageFrom": [
55
- "lib/**/*.js",
56
- "!lib/**/index.js"
57
- ],
58
- "coveragePathIgnorePatterns": [
59
- "/node_modules/",
60
- "/test/"
61
- ]
62
- }
63
- }
1
+ {
2
+ "name": "@jeffcaradona/eslint-plugin-eta",
3
+ "version": "0.3.0",
4
+ "description": "An ESLint plugin so you can lint Eta template files (forked from bgub/eslint-plugin-eta)",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "require": "./dist/index.cjs"
12
+ }
13
+ },
14
+ "scripts": {
15
+ "build": "tsup",
16
+ "test": "jest --coverage",
17
+ "test:prod": "npm run lint && npm run test -- --no-cache",
18
+ "test:watch": "jest --coverage --watch",
19
+ "format": "prettier --write lib/**/*.js test/**/*.js",
20
+ "lint": "eslint lib/**/*.js test/**/*.js --ext .js",
21
+ "report-coverage": "cat ./coverage/lcov.info | coveralls",
22
+ "prepublishOnly": "npm run build"
23
+ },
24
+ "keywords": [
25
+ "eslint",
26
+ "eslintplugin"
27
+ ],
28
+ "author": "jeffcaradona <jeffcaradona@gmail.com>",
29
+ "contributors": [
30
+ "Ben Gubler (Original Author)"
31
+ ],
32
+ "engines": {
33
+ "node": ">=18.18.0"
34
+ },
35
+ "license": "MIT",
36
+ "files": [
37
+ "dist"
38
+ ],
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "git+https://github.com/jeffcaradona/eslint-plugin-eta.git"
42
+ },
43
+ "peerDependencies": {
44
+ "eslint": ">=9 <10",
45
+ "eta": ">=1.0.0 <5.0.0"
46
+ },
47
+ "devDependencies": {
48
+ "@babel/preset-env": "^7.28.5",
49
+ "@istanbuljs/load-nyc-config": "^1.1.0",
50
+ "@typescript-eslint/eslint-plugin": "^8.50.0",
51
+ "@typescript-eslint/parser": "^8.50.0",
52
+ "babel-jest": "^30.2.0",
53
+ "eslint": "^9.39.2",
54
+ "eslint-plugin-import": "^2.32.0",
55
+ "eslint-plugin-promise": "^7.2.1",
56
+ "eta": "^3.5.0",
57
+ "jest": "^30.2.0",
58
+ "prettier": "^3.7.4",
59
+ "tsup": "^8.5.1",
60
+ "typescript": "^5.9.3"
61
+ },
62
+ "jest": {
63
+ "testEnvironment": "node",
64
+ "transform": {
65
+ "^.+\\.jsx?$": "babel-jest"
66
+ },
67
+ "collectCoverageFrom": [
68
+ "lib/**/*.js",
69
+ "!lib/**/index.js"
70
+ ],
71
+ "coveragePathIgnorePatterns": [
72
+ "/node_modules/",
73
+ "/test/"
74
+ ]
75
+ }
76
+ }
package/.babelrc.json DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "presets": [
3
- ["@babel/preset-env", { "targets": { "node": "22" } }]
4
- ]
5
- }
package/.prettierignore DELETED
@@ -1,2 +0,0 @@
1
- node_modules
2
- coverage
package/.prettierrc DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "semi": false,
3
- "singleQuote": true,
4
- "trailingComma": "none"
5
- }
package/lib/index.js DELETED
@@ -1,7 +0,0 @@
1
- import eta from './processors/eta.js'
2
-
3
- export default {
4
- processors: {
5
- eta: eta
6
- }
7
- }
@@ -1,26 +0,0 @@
1
- import { Eta } from 'eta'
2
-
3
- export default {
4
- preprocess: (text, _filename) => {
5
- const eta = new Eta({
6
- parse: {
7
- exec: '',
8
- interpolate: '=',
9
- raw: '~'
10
- },
11
- tags: ['<%', '%>']
12
- })
13
- let result = eta.parse(text)
14
-
15
- const text_content = result
16
- .filter((res) => res.t === 'r' || res.t === 'i' || res.t === 'e')
17
- .map((res) => String(res.val))
18
- .join('\n')
19
-
20
- return [{ text: text_content, filename: _filename }]
21
- },
22
-
23
- postprocess: (messages, _filename) => {
24
- return messages.flat()
25
- }
26
- }
@@ -1,15 +0,0 @@
1
- sonar.projectKey=jeffcaradona_eslint-plugin-eta
2
- sonar.organization=xbe90seup2ltm6gwmugkq
3
-
4
- # Project settings
5
- sonar.projectName=eslint-plugin-eta
6
- sonar.projectVersion=0.2.2
7
- sonar.sourceEncoding=UTF-8
8
-
9
- # Source code
10
- sonar.sources=lib
11
- sonar.tests=test
12
- sonar.javascript.lcov.reportPaths=coverage/lcov.info
13
-
14
- # Coverage
15
- sonar.coverage.exclusions=lib/**/index.js