Skip to content

Commit

Permalink
Prepare support for eslint and editorconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
mar10 committed May 1, 2017
1 parent 6ab186d commit 6dd4d96
Show file tree
Hide file tree
Showing 8 changed files with 228 additions and 54 deletions.
30 changes: 16 additions & 14 deletions .editorconfig
@@ -1,26 +1,28 @@
; EditorConfig is awesome: http://EditorConfig.org
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

; top-most EditorConfig file
root = true

; Unix-style newlines with a newline ending every file
[*]
; end_of_line = lf
insert_final_newline = true
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

; 4 space indentation
[*.py]
[package.json]
indent_style = space
indent_size = 4
indent_size = 2

; Tab indentation (no size specified)
[*.js]
; indent_style = tab
[Gruntfile.coffee]
indent_style = space
indent_size = 2

[*.py]
indent_style = space
indent_size = 4

; Indentation override for all JS under lib directory
[lib/**.js]
indent_style = space
indent_size = 2
;[lib/**.js]
;indent_style = space
;indent_size = 2
10 changes: 10 additions & 0 deletions .eslintignore
@@ -0,0 +1,10 @@
bin
doc
lib
node_modules
test/**
!test/unit/**
*.min.js
build/**
dist/**
!dist/jquery.js
145 changes: 145 additions & 0 deletions .eslintrc.json
@@ -0,0 +1,145 @@
{
"rules": {
"no-negated-in-lhs": "error",
"no-cond-assign": [
"error",
"except-parens"
],
"curly": [
"error",
"all"
],
"object-curly-spacing": [
"error",
"always"
],
"computed-property-spacing": [
"error",
"always"
],
"array-bracket-spacing": [
"error",
"always"
],
"eqeqeq": [
"error",
"smart"
],
"no-unused-expressions": "error",
"no-sequences": "error",
"no-nested-ternary": "error",
"no-unreachable": "error",
"wrap-iife": [
"error",
"inside"
],
"no-caller": "error",
"quotes": [
"error",
"double"
],
"no-undef": "error",
"no-unused-vars": "error",
"operator-linebreak": [
"error",
"after"
],
"comma-style": [
"error",
"last"
],
"camelcase": [
"error",
{
"properties": "never"
}
],
"dot-notation": [
"error",
{
"allowPattern": "^[a-z]+(_[a-z]+)+$"
}
],
"max-len": [
"error",
{
"code": 100,
"ignoreComments": true,
"ignoreUrls": true,
"ignoreRegExpLiterals": true
}
],
"no-mixed-spaces-and-tabs": "error",
"no-trailing-spaces": "error",
"no-multi-str": "error",
"comma-dangle": [
"error",
"never"
],
"comma-spacing": [
"error",
{
"before": false,
"after": true
}
],
"space-before-blocks": [
"error",
"always"
],
"space-in-parens": [
"error",
"always"
],
"keyword-spacing": [
2
],
"semi": [
"error",
"always"
],
"semi-spacing": [
"error",
{
// Because of the `for ( ; ...)` requirement
// "before": true,
"after": true
}
],
"space-infix-ops": "error",
"eol-last": "error",
"lines-around-comment": [
"error",
{
"beforeLineComment": true
}
],
"linebreak-style": [
"error",
"unix"
],
"no-with": "error",
"brace-style": "error",
"space-before-function-paren": [
"error",
"never"
],
"no-loop-func": "error",
"no-spaced-func": "error",
"key-spacing": [
"error",
{
"beforeColon": false,
"afterColon": true
}
],
"space-unary-ops": [
"error",
{
"words": false,
"nonwords": false
}
],
"no-multiple-empty-lines": 2
}
}
50 changes: 25 additions & 25 deletions CHANGELOG.md
Expand Up @@ -37,14 +37,14 @@
If the tree container has a fixed height, `overflow: auto` or `overflow: scroll`
should be added to make it scrollable.
(Otherwise this always would be the scroll parent for ext-dnd5.)
* [Improved] better support for initializing from embedded JSON using the
* [Improved] better support for initializing from embedded JSON using the
`data-type="json"` attribute
* [Fixed] corner case of #658 when ext-edit is loaded, but inactive
* [Fixed] #396 Don't load 'loading.gif' for glyph skins
* [Fixed] #675 ext-table: node.render(false) puts first node at end

# 2.20.0 / 2016-11-13
* [Added] #419 `modifyChild` event. This event is also a good place to
* [Added] #419 `modifyChild` event. This event is also a good place to
implement auto sorting (#559)
* [Added] #419 node.triggerModifyChild() and node.triggerModify()
* [Added] #595 add custom node filter to `generateFormElements()`
Expand All @@ -54,7 +54,7 @@
'remove' instead (which is fired on the parent)
* [Improved] ThemeRoller theme
* [Improved] ext-filter
- #297 add filter option 'hideExpanders' to remove expanders if all child
- #297 add filter option 'hideExpanders' to remove expanders if all child
nodes are hidden by filter
- Filter options and the `opts` argument of `filterNodes()` / `filterBranches()`
have been unified
Expand All @@ -73,12 +73,12 @@
* [Fixed] #615 Drag & drop helper icons lose indentation with table extension
* [Fixed] #632 Tabbing is not working if there is an anchor tag in treeview
* [Fixed] #644 New nodes created with ext-edit, are hidden in filtered trees
* [Fixed] #647 ext-table: tree.render(true) does not discard existing markup
* [Fixed] #647 ext-table: tree.render(true) does not discard existing markup
* [Fixed] #659 handling of function keys, when quicksearch is on
* Use QUnit 2.0

# 2.19.0 / 2016-08-11
* [Added] #607 tree.enableUpdate() to temporarily disable rendering to improve
* [Added] #607 tree.enableUpdate() to temporarily disable rendering to improve
performance on bulk updates
* [Added] modifier class `.fancytree-connectors` to be set on container<br>
Note: Experimental! Not required for skin-xp and not compatible with ext-table
Expand All @@ -93,12 +93,12 @@
* [Added] #586 node.discardMarkup() (useful in the `collapsed` event)
* [Added] #171 new option `.escapeTitles`
* [Added] new callback `.enhanceTitle()`
* [Fixed] #515 Html tags included in filter results
* [Fixed] #515 Html tags included in filter results
* [Fixed] #593 ext-dnd revert position fails for tables

# 2.17.0 / 2016-04-11
* [Added] `node.addClass()`, `.removeClass()`, and `.toggleClass()`
* [Added] ext-filter: matcher-callback for `tree.filterNodes()` may now return
* [Added] ext-filter: matcher-callback for `tree.filterNodes()` may now return
`"branch"` and `"skip"`
* [Added] ext-filter: new option`nodata` allows to configure a status node for
empty results
Expand All @@ -125,12 +125,12 @@
* [Improved] status nodes don't have icons
* [Improved] pass data argument to `source` callback
* [Improved] Handle exceptions inside `postProcess`
* [Improved] #568 ext-dnd: Auto-expanding of collapsed nodes should also work
* [Improved] #568 ext-dnd: Auto-expanding of collapsed nodes should also work
when dropping is not allowed
* [Improved] #567 ext-dnd: fix revert position
* [Improved] #565 ext-dnd: fix intermediate display of wrong icon (sending 'over' after 'enter')
* [Fixed] #569 node.navigate does not return a Promise object
* [Fixed] #563 `tree.reactivate(false)` sets fancytree-treefocus and `tree.reactivate(true)`
* [Fixed] #563 `tree.reactivate(false)` sets fancytree-treefocus and `tree.reactivate(true)`
doesn't set keyboard focus
* [Fixed] #562 Node span tag leaks outside table cell
* [Fixed] #526 tree.setFocus() does not set keyboard focus
Expand Down Expand Up @@ -161,7 +161,7 @@
* [Added] `options.icon` option/callback.<br>
Valid values are true, false, a string containing a class name or image
url, or a callback returning that.
* [Changed] `node.icon` option. Valid values are true, false, or a string
* [Changed] `node.icon` option. Valid values are true, false, or a string
containing a class name or image url.<br>
This option existed before, but was stored in the `node.data.icon` namespace,
and did not accept class names.
Expand All @@ -174,21 +174,21 @@
* [Fixed] #533 table-ext: nodeSetExpanded triggers redundant events

# 2.13.0 / 2015-11-16
* [Changed] If a node is initalized as `lazy: true`, and `children: []`,
* [Changed] If a node is initalized as `lazy: true`, and `children: []`,
treat it as 'loaded leaf node'.<br>
This is consistent with a lazy node that has no children property at all (i.e.
This is consistent with a lazy node that has no children property at all (i.e.
`undefined`). This would issue a lazyLoad event and a resopnse of `[]` would
mark the node as leaf node.
* [Added] new function $.ui.fancytree.getTree()
* [Added] ext-filter methods node.isMatched() and tree.isFilterActive()
* [Added] CSS for ext-childcounter badges is now part of the standard themes
* [Added] ext-childcounter method node.updateCounter()`
* [Fixed] #507 data-hideCheckbox="true"
* [Fixed] #507 data-hideCheckbox="true"
* [Fixed] #513 activeVisible option does not work on init
* [Fixed] #516 ExtPersist requires cookie.js even when not using cookies

# 2.12.0 / 2015-09-10
* [Changed] Documented `iconClass` callback and changed signature from
* [Changed] Documented `iconClass` callback and changed signature from
`iconClass(node)` to `iconClass(event, data)`
* [Added] ext-dnd events `initHelper` and `updateHelper`
* [Added] ext-dnd option `smartRevert`
Expand Down Expand Up @@ -227,7 +227,7 @@
dist/skin-common.less

# 2.10.0 / 2015-06-26 [YANKED]
* [Changed] #340: New dist folder layout: moved skin-* folders into src/ folder
* [Changed] #340: New dist folder layout: moved skin-* folders into src/ folder
(**Note:** this change was reverted in v2.10.1)
* [Improved] Update to jQuery UI 1.11.4, jQuery 1.11.3
* [Improved] #340: add `dist/skin-common.less` to fix theme imports
Expand Down Expand Up @@ -268,7 +268,7 @@

# 2.7.0 / 2014-12-21
* [CHANGED] Dropped `fx` option. Use `toggleEffect` instead.
* [CHANGED] 'win8' and 'bootstrap' skins where modified to highlight the
* [CHANGED] 'win8' and 'bootstrap' skins where modified to highlight the
title span instead of the node span, in order to be compatible with
[ext-wide]. The original skins are available as 'skin-win8-n' and
'skin-bootstrap-n' respectively.
Expand All @@ -282,7 +282,7 @@
* [Fixed] #369 Suppress warning, when dropping top- on top-node

# 2.6.0 / 2014-11-29
* [Added] Option `focusOnSelect` to set focus when node is checked by a mouse
* [Added] Option `focusOnSelect` to set focus when node is checked by a mouse
click (default: false)
* [Added] `restore` event, sent after ext-persist has restored the tree state
* [Improved] #359 Better navigation performance when skipping hidden nodes
Expand Down Expand Up @@ -335,12 +335,12 @@
* [Fixed] #257 Glyph expander sometimes disappears

# 2.2.0 / 2014-06-28
* [Added] Option dnd.focusOnClick sets focus to tree widget, even when dragging
* [Added] Option dnd.focusOnClick sets focus to tree widget, even when dragging
is enabled
* [Added] node.info()
* [Improved] #245 tree.generateInput() now returns data using PHPs array
convention, i.e. by appending brackets to the name: 'ft_1[]'.
* [Fixed] #250: Children lazy empty nodes remain checked when parent is
* [Fixed] #250: Children lazy empty nodes remain checked when parent is
unchecked with hierarchical multi-selection
* [Fixed] #272 Navigation in filtered trees

Expand All @@ -349,7 +349,7 @@
* [Added] #210: [ext-persist] optionally store information in sessionStorage or localStorage
* [Added] #64 [ext-filter] filterBranches() will restrict display to sub-trees
* [Added] New options 'scrollParent' and 'scrollOfs' are evaluated by node.scrollIntoView()
(which is also called on expand). This allows autoScroll to work with
(which is also called on expand). This allows autoScroll to work with
[ext-table]: set scrollParent to `window` or a wrapper DIV with overflow: auto
* [Added] [ext-wide] use 100% wide selection bar (experimental)
* [Added] $.ui.fancytree.debounce()
Expand Down Expand Up @@ -380,9 +380,9 @@
* [Added] #56: Allow to set special node.attributes from data-...
* [Added] #191: Allow to set additional tree.data attributes from <ul data-...>
* [Added] [ext-childcounter] #202: Allow lazy children count
* [Improved] #192: Removed 'height: 100%' for container (was introduced to fix
* [Improved] #192: Removed 'height: 100%' for container (was introduced to fix
an IE 9 bug, that now should be solved by 'min-height: 0%')
* [Improved] [ext-table] #93 renderColumns called for status nodes
* [Improved] [ext-table] #93 renderColumns called for status nodes
(added 'customStatus' option)
* [Improved] [ext-dnd] #196 Make draggable/droppable options configurable
* [Fixed] [ext-glyph] #194 Render noExpander icon from icon map for leaf nodes
Expand Down Expand Up @@ -420,8 +420,8 @@
* [BUGFIX] #117: line height too large when using doctype xhtml
* [BUGFIX] #115: Fixed error when trying to drag table headers
* [BUGFIX] #163: lazy load throws error if autoscroll: true and result is empty
* [FEATURE] [ext-clones] (experimental) new extension that introduces
`node.refKey`, which may occur multiple times in one tree (as opposed to `key`,
* [FEATURE] [ext-clones] (experimental) new extension that introduces
`node.refKey`, which may occur multiple times in one tree (as opposed to `key`,
which must be unique).
New methods `node.isClone()`, `node.getCloneList()` and `tree.getNodesByRef()`.
Optionally, clones are tagged wit the `fancytree-clone` class.
Expand All @@ -442,7 +442,7 @@
* [FEATURE] node.makeVisible() accepts options, scrolls into view, and returns a promise.
* [FEATURE] Sample xxl and bootstrap themes.
* [CHANGE] nodeRenderStatus() is now implicitly called by nodeRenderTitle().<br>
This also means that now all markup and css classes are finshed, when `renderNode`
This also means that now all markup and css classes are finshed, when `renderNode`
is fired.
* [CHANGE] Calling setExpanded() on a leaf node fires .done() (not .fail())
* [CHANGE] Removing the last child node collapses the parent; lazy nodes become empty (not undefined).
Expand Down

0 comments on commit 6dd4d96

Please sign in to comment.