Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warn if import contains ".." that traverses outside the package boundary #9734

Open
danrubel opened this issue Apr 7, 2013 · 16 comments
Open
Labels
analyzer-warning Issues with the analyzer's Warning codes area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@danrubel
Copy link

danrubel commented Apr 7, 2013

Two cases, maybe more, where we should warn the user of a bad practice...

  1. Traversing into or out of the "lib" directory with a package
  2. Traversing out of one package into another

import '../lib/foo.dart';
import 'package:anypkg/../web/bar.dart';

@lrhn
Copy link
Member

lrhn commented Apr 8, 2013

Could we make it just not work?
I.e., treat a package: URI as a special kind of URI, not just as a shorthand for a file: URI. Then "package:<packageName>/<absolutePath>" would be the required format, and it would simply not be allowed to reach outside of "lib/packageName".

If we just transform it to a file URI blindly, then all kinds of hackery is possible, so the safest thing is to just not do that.

@danrubel
Copy link
Author

danrubel commented Apr 8, 2013

That makes sense to me. Are there issues open for VM and dart2js to disallow this situation?

@clayberg
Copy link

clayberg commented Apr 8, 2013

Added this to the M5 milestone.

@jwren
Copy link
Member

jwren commented Apr 9, 2013

Added Editor-AnalysisEngine label.

@clayberg
Copy link

Removed Editor-AnalysisEngine label.

@bwilkerson
Copy link
Member

Has there been any progress on this issue? We need to be consistent with dart2js and the VM.


Set owner to @danrubel.

@danrubel
Copy link
Author

@danrubel
Copy link
Author

Removed this from the M5 milestone.
Added this to the M6 milestone.

@danrubel
Copy link
Author

Removed this from the M6 milestone.
Added this to the M7 milestone.

@danrubel
Copy link
Author

danrubel commented Oct 1, 2013

Removed this from the M7 milestone.
Added this to the M8 milestone.

@clayberg
Copy link

Removed this from the M8 milestone.
Added this to the Later milestone.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@sethladd
Copy link
Contributor

Added NotPlanned label.

@danrubel
Copy link
Author

This was miscategerized as an editor issue... reopening and moving to analyzer


Removed Area-Editor, Oldschool-Milestone-Later labels.
Added Area-Analyzer, Triaged labels.

@bwilkerson
Copy link
Member

Added Analyzer-Hint label.

@danrubel
Copy link
Author

@danrubel danrubel added Type-Enhancement area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-warning Issues with the analyzer's Warning codes labels Feb 11, 2015
@danrubel danrubel self-assigned this Feb 11, 2015
@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug and removed triaged labels Feb 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-warning Issues with the analyzer's Warning codes area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

9 participants