wrec 0.30.0 → 0.30.2
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/package.json +1 -1
- package/scripts/lint.js +9 -0
- package/scripts/used-by.js +7 -0
package/package.json
CHANGED
package/scripts/lint.js
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
// - undefined context functions called in expressions
|
|
13
13
|
// - extra arguments passed to methods and context functions
|
|
14
14
|
// - incompatible method arguments in expressions
|
|
15
|
+
// - incompatible context function arguments in expressions
|
|
15
16
|
// - arithmetic type errors in expressions
|
|
16
17
|
// - invalid computed property references and calls to non-method members
|
|
17
18
|
// - invalid event handler references
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
// - invalid `useState` map entries
|
|
28
29
|
// - unsupported HTML attributes in templates
|
|
29
30
|
// - invalid HTML element nesting in templates
|
|
31
|
+
// - invalid ref attribute targets
|
|
30
32
|
// - duplicate ref attribute values
|
|
31
33
|
|
|
32
34
|
import fs from 'node:fs';
|
|
@@ -1396,6 +1398,13 @@ export function lintSource(filePath, sourceText, options = {}) {
|
|
|
1396
1398
|
// Runs the command-line interface for the linter.
|
|
1397
1399
|
function main() {
|
|
1398
1400
|
const args = process.argv.slice(2);
|
|
1401
|
+
const unknownFlags = args.filter(
|
|
1402
|
+
arg => arg.startsWith('--') && arg !== '--verbose'
|
|
1403
|
+
);
|
|
1404
|
+
if (unknownFlags.length > 0) {
|
|
1405
|
+
fail(`unknown option: ${unknownFlags[0]}`);
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1399
1408
|
const verbose = args.includes('--verbose');
|
|
1400
1409
|
const positionalArgs = args.filter(arg => arg !== '--verbose');
|
|
1401
1410
|
|
package/scripts/used-by.js
CHANGED
|
@@ -638,6 +638,13 @@ function isSupportedSourceFile(filePath, excludeTests = false) {
|
|
|
638
638
|
// Handles CLI arguments and runs the script.
|
|
639
639
|
function main() {
|
|
640
640
|
const args = process.argv.slice(2);
|
|
641
|
+
const unknownFlags = args.filter(
|
|
642
|
+
arg => arg.startsWith('--') && arg !== '--dry'
|
|
643
|
+
);
|
|
644
|
+
if (unknownFlags.length > 0) {
|
|
645
|
+
throw new Error(`unknown option: ${unknownFlags[0]}`);
|
|
646
|
+
}
|
|
647
|
+
|
|
641
648
|
const inputPaths = args.filter(arg => !arg.startsWith('--'));
|
|
642
649
|
|
|
643
650
|
if (inputPaths.length !== 1) {
|