Skip to content
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.

Commit

Permalink
Merge branch 'therealjs'
Browse files Browse the repository at this point in the history
  • Loading branch information
pelmers committed May 26, 2016
2 parents a96dea2 + cdf365a commit 0baeb58
Show file tree
Hide file tree
Showing 18 changed files with 1,190 additions and 206 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ recursive-include docs *
include dxr/format
include dxr/static_manifest
recursive-include dxr/plugins *.py *.so
recursive-include dxr/plugins/js/analyze_js *
recursive-include dxr/static *
recursive-include dxr/templates *
recursive-include dxr/hgext *
30 changes: 30 additions & 0 deletions dxr/plugins/js/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""JS plugin: analyze Javascript files by building a symbol map on parse by
esprima.
"""

from dxr.plugins import Plugin, filters_from_namespace, refs_from_namespace
from dxr.filters import LINE
from dxr.indexers import QUALIFIED_LINE_NEEDLE
from dxr.plugins.js.indexers import TreeToIndex
from dxr.plugins.js.refs import PLUGIN_NAME
from dxr.plugins.js import refs, filters


mappings = {
LINE: {
'properties': {
PLUGIN_NAME + '_prop': QUALIFIED_LINE_NEEDLE,
PLUGIN_NAME + '_var': QUALIFIED_LINE_NEEDLE,
PLUGIN_NAME + '_prop_ref': QUALIFIED_LINE_NEEDLE,
PLUGIN_NAME + '_var_ref': QUALIFIED_LINE_NEEDLE
}
}
}


plugin = Plugin(
tree_to_index=TreeToIndex,
mappings=mappings,
refs=refs_from_namespace(refs.__dict__),
filters=filters_from_namespace(filters.__dict__),
)
18 changes: 18 additions & 0 deletions dxr/plugins/js/analyze_js/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
env:
es6: true
mocha: true
node: true

extends:
- eslint:recommended

rules:
indent: [2, 2]
no-trailing-spaces: 2
no-unused-vars: [2, {vars: all, args: none}]
no-use-before-define: [error, {functions: false, classes: false}]
no-var: 1
no-warning-comments: [1, {terms: [xxx, fixme, hack], location: start}]
object-shorthand: [2, properties]
prefer-const: 1
no-console: 0

0 comments on commit 0baeb58

Please sign in to comment.