mirror of
https://github.com/affaan-m/ECC.git
synced 2026-11-07 08:35:54 +00:00
maint: integrate reviewed contribution #3591
This commit is contained in:
2 files changed
+41
-2
No files matched your search
@@ -9,7 +9,6 @@
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
/**
|
||||
* Language detection rules.
|
||||
@@ -350,6 +349,10 @@ function hasFlutterSdkDependency(projectDir) {
|
||||
const pubspecPath = path.join(projectDir, 'pubspec.yaml');
|
||||
if (!fs.existsSync(pubspecPath)) return false;
|
||||
const content = fs.readFileSync(pubspecPath, 'utf8');
|
||||
// Loaded here, not at the top: the SessionStart hook requires this module
|
||||
// from plugin installs that have no node_modules (#2822). Without js-yaml
|
||||
// the catch below costs only the Flutter check, not the whole hook.
|
||||
const yaml = require('js-yaml');
|
||||
const pubspec = yaml.load(content, { schema: yaml.JSON_SCHEMA });
|
||||
// Only a declared Flutter SDK dependency identifies the framework.
|
||||
// Unrelated configuration, comments, and strings must not count.
|
||||
|
||||
Reference in new issue
Block a user