├── .npmignore ├── .gitignore ├── .editorconfig ├── src ├── index.js ├── doc.js ├── build.js └── dev.js ├── package.json ├── LICENSE ├── ISSUE_TEMPLATE.md ├── README.md └── .eslintrc.json /.npmignore: -------------------------------------------------------------------------------- 1 | jspm_packages 2 | bower_components 3 | .idea -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | jspm_packages 3 | bower_components 4 | .idea 5 | .DS_STORE -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | 11 | # 2 space indentation 12 | [**.*] 13 | indent_style = space 14 | indent_size = 2 -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | var doc = require('./doc'); 2 | var dev = require('./dev'); 3 | var build = require('./build'); 4 | 5 | module.exports = { 6 | transformAPIModel:doc.transformAPIModel, 7 | updateOwnDependenciesFromLocalRepositories:dev.updateOwnDependenciesFromLocalRepositories, 8 | buildDevEnv:dev.buildDevEnv, 9 | pullDevEnv:dev.pullDevEnv, 10 | extractImports:build.extractImports, 11 | createImportBlock:build.createImportBlock, 12 | sortFiles:build.sortFiles, 13 | cleanGeneratedCode: build.cleanGeneratedCode 14 | }; 15 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "aurelia-tools", 3 | "version": "2.0.0", 4 | "description": "Tools and utility functions used to build and develop Aurelia's libraries.", 5 | "keywords": [ 6 | "aurelia", 7 | "tools" 8 | ], 9 | "homepage": "http://aurelia.io", 10 | "bugs": { 11 | "url": "https://github.com/aurelia/tools/issues" 12 | }, 13 | "license": "MIT", 14 | "author": "Rob Eisenberg (http://robeisenberg.com/)", 15 | "main": "src/index.js", 16 | "repository": { 17 | "type": "git", 18 | "url": "http://github.com/aurelia/tools" 19 | }, 20 | "dependencies": { 21 | "breeze-dag": "^0.1.0", 22 | "through2": "^2.0.0" 23 | }, 24 | "peerDependencies": { 25 | "babel-eslint": "^7.0.0 || ^8.0.0", 26 | "eslint": "^4.0.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2010 - 2016 Blue Spire Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 19 | **I'm submitting a bug report** 20 | **I'm submitting a feature request** 21 | 22 | * **Library Version:** 23 | major.minor.patch-pre 24 | 25 | 26 | **Please tell us about your environment:** 27 | * **Operating System:** 28 | OSX 10.x|Linux (distro)|Windows [7|8|8.1|10] 29 | 30 | * **Node Version:** 31 | 6.2.0 32 | 36 | 37 | * **NPM Version:** 38 | 3.8.9 39 | 43 | 44 | * **Browser:** 45 | all | Chrome XX | Firefox XX | Edge XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView 46 | 47 | * **Language:** 48 | all | TypeScript X.X | ESNext 49 | 50 | 51 | **Current behavior:** 52 | 53 | 54 | **Expected/desired behavior:** 55 | 62 | 63 | 64 | * **What is the expected behavior?** 65 | 66 | 67 | * **What is the motivation / use case for changing the behavior?** 68 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # aurelia-tools 2 | 3 | [![npm Version](https://img.shields.io/npm/v/aurelia-tools.svg)](https://www.npmjs.com/package/aurelia-tools) 4 | [![ZenHub](https://raw.githubusercontent.com/ZenHubIO/support/master/zenhub-badge.png)](https://zenhub.io) 5 | [![Join the chat at https://gitter.im/aurelia/discuss](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/aurelia/discuss?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 6 | 7 | This library is part of the [Aurelia](http://www.aurelia.io/) platform and contains some base tools used in the development of Aurelia itself as well as the source for browser debugging tools. 8 | 9 | > To keep up to date on [Aurelia](http://www.aurelia.io/), please visit and subscribe to [the official blog](http://blog.aurelia.io/) and [our email list](http://eepurl.com/ces50j). We also invite you to [follow us on twitter](https://twitter.com/aureliaeffect). If you have questions, please [join our community on Gitter](https://gitter.im/aurelia/discuss) or use [stack overflow](http://stackoverflow.com/search?q=aurelia). Documentation can be found [in our developer hub](http://aurelia.io/hub.html). If you would like to have deeper insight into our development process, please install the [ZenHub](https://zenhub.io) Chrome or Firefox Extension and visit any of our repository's boards. 10 | 11 | ## To create a dev environment: 12 | 13 | 1. Create an aurelia directory to hold all of the projects. 14 | 15 | ```shell 16 | mkdir aurelia 17 | ``` 18 | 2. Change to the new directory 19 | 20 | ```shell 21 | cd aurelia 22 | ``` 23 | 3. Clone this repository into the `tools` directory. This repo contains the helper tools for creating the dev environment. 24 | 25 | ```shell 26 | git clone https://github.com/aurelia/tools.git 27 | ``` 28 | 4. Clone the skeleton-navigation also which is the base app for testing - 29 | 30 | ```shell 31 | git clone https://github.com/aurelia/skeleton-navigation.git 32 | ``` 33 | 5. Change directory into skeleton-navigation 34 | 35 | ```shell 36 | cd skeleton-navigation 37 | ``` 38 | 6. Install the skeleton-navigation application's dependencies: 39 | 40 | ```shell 41 | npm install 42 | jspm install 43 | ``` 44 | 7. Build the dev environment. This will create all of the directories inside of `aurelia` under the proper name, `git clone` them all and then perform a `gulp build`. 45 | 46 | ```shell 47 | gulp build-dev-env 48 | ``` 49 | 50 | Now you have the ability to update the repos locally, make changes, and use those in the skeleton app in the `aurelia` directory by using the `gulp update-own-deps` command. 51 | 52 | Alternatively, run `gulp pull-dev-env` to only pull down each `aurelia` dependency and not perform builds. 53 | 54 | ## Aurelia Context Chrome extension 55 | 56 | The chrome extension has moved to the [aurelia/inspector](https://github.com/aurelia/inspector) repo. 57 | -------------------------------------------------------------------------------- /src/doc.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | 3 | module.exports = { 4 | transformAPIModel:function(docPath){ 5 | var api = JSON.parse(fs.readFileSync(docPath + '/api.json', 'utf-8')), 6 | classes = [], 7 | methods = [], 8 | properties = [], 9 | events = [], 10 | moduleName, moduleDescription; 11 | 12 | function categorizeMember(item, methods, properties, events){ 13 | switch(item.itemtype){ 14 | case 'method': 15 | methods.push(item); 16 | break; 17 | case 'property': 18 | properties.push(item); 19 | break; 20 | case 'event': 21 | events.push(item); 22 | break; 23 | default: 24 | console.warn('API DOC Item Type "' + item.itemtype + '" is not supported.'); 25 | break; 26 | } 27 | 28 | delete item.itemtype; 29 | } 30 | 31 | function processClassItem(item){ 32 | delete item.module; 33 | 34 | if(item.class){ 35 | if(item.class === 'export'){ 36 | delete item.class; 37 | item.file = item.file.substring(item.file.indexOf('aurelia')); 38 | categorizeMember(item, methods, properties, events); 39 | }else{ 40 | var owner = api.classes[item.class]; 41 | owner.methods = owner.methods || []; 42 | owner.properties = owner.properties || []; 43 | owner.events = owner.events || []; 44 | 45 | delete item.class; 46 | delete item.file; 47 | categorizeMember(item, owner.methods, owner.properties, owner.events); 48 | } 49 | }else{ 50 | item.file = item.file.substring(item.file.indexOf('aurelia')); 51 | categorizeMember(item, methods, properties, events); 52 | } 53 | } 54 | 55 | for(var name in api.classes){ 56 | var value = api.classes[name]; 57 | if(!value.file){ 58 | continue; 59 | } 60 | 61 | delete value.shortname; 62 | delete value.plugins; 63 | delete value.plugin_for; 64 | delete value.extensions; 65 | delete value.extension_for; 66 | delete value.namespace; 67 | delete value.module; 68 | delete value.classitems; 69 | 70 | value.methods = []; 71 | value.properties = []; 72 | value.events = []; 73 | value.file = value.file.substring(value.file.indexOf('aurelia')); 74 | 75 | classes.push(value); 76 | } 77 | 78 | api.classitems.forEach(processClassItem); 79 | 80 | for(var name in api.modules){ 81 | moduleName = name; 82 | moduleDescription = api.modules[name].description; 83 | break; 84 | } 85 | 86 | fs.writeFileSync(docPath + '/api.json', JSON.stringify({ 87 | name:moduleName, 88 | description: moduleDescription, 89 | classes: classes, 90 | methods: methods, 91 | properties: properties, 92 | events: events 93 | })); 94 | } 95 | }; -------------------------------------------------------------------------------- /src/build.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var dag = require('breeze-dag'); 3 | var through2 = require('through2'); 4 | 5 | var relativeImports = /import\s*{[a-zA-Z0-9_\$\,\s]+}\s*from\s*'(\.[^\s']+)';\s*/g; 6 | var nonRelativeImports = /import(\s*{?[a-zA-Z0-9_\$\*\,\s]+}?)?(\s*as\s*[a-zA-Z0-9_\$]+)?(\s*from)?\s*'[a-zA-Z0-9_\-\/]+';\s*/g; 7 | var importGrouper = /import\s*{([a-zA-Z0-9_\$\,\s]+)}\s*from\s*'([a-zA-Z0-9_\-\/]+)'\s*;\s*/; 8 | 9 | exports.sortFiles = function sortFiles() { 10 | var edges = []; 11 | var files = {}; 12 | 13 | function getImports(file) { 14 | var contents = file.contents; 15 | var deps = []; 16 | var match; 17 | while (match = relativeImports.exec(contents)) { 18 | deps.push(path.relative(file.base, path.resolve(path.dirname(file.path), match[1] + '.js'))); 19 | } 20 | 21 | return deps; 22 | } 23 | 24 | function bufferFile(file, enc, callback) { 25 | var imports = getImports(file); 26 | if (!imports.length) { 27 | // include a null dependency so disconnected nodes will be included in the DAG traversal 28 | imports = [null]; 29 | } 30 | 31 | imports.forEach(function(dependency) { 32 | edges.push([dependency, file.relative]); 33 | }); 34 | 35 | files[file.relative] = file; 36 | callback(); 37 | } 38 | 39 | function endStream(callback) { 40 | var self = this; 41 | 42 | dag(edges, 1, function(filePath, next) { 43 | self.push(files[filePath]); 44 | next(); 45 | }, callback); 46 | } 47 | 48 | return through2.obj(bufferFile, endStream); 49 | }; 50 | 51 | exports.extractImports = function(content, importsToAdd){ 52 | var matchesToKeep = content.match(nonRelativeImports); 53 | 54 | if(matchesToKeep){ 55 | matchesToKeep.forEach(function(toKeep){ importsToAdd.push(toKeep) }); 56 | } 57 | 58 | content = content.replace(nonRelativeImports, ''); 59 | content = content.replace(relativeImports, ''); 60 | 61 | return content; 62 | }; 63 | 64 | exports.createImportBlock = function(importsToAdd){ 65 | var finalImports = {}, importBlock = ''; 66 | 67 | importsToAdd.forEach(function(toAdd){ 68 | var groups = importGrouper.exec(toAdd); 69 | if(!groups) { 70 | toAdd = toAdd.trim(); 71 | if(importBlock.indexOf(toAdd) === -1){ 72 | importBlock += toAdd + '\n'; 73 | } 74 | 75 | return; 76 | }; 77 | 78 | var theImports = groups[1].split(','); 79 | var theSource = groups[2].trim(); 80 | var theList = finalImports[theSource] || (finalImports[theSource] = []); 81 | 82 | theImports.forEach(function(item){ 83 | item = item.trim(); 84 | if(theList.indexOf(item) === -1){ 85 | theList.push(item); 86 | } 87 | }); 88 | }); 89 | 90 | Object.keys(finalImports).forEach(function(key) { 91 | importBlock += 'import {' + finalImports[key].join(',') + '} from \'' + key + '\';\n'; 92 | }); 93 | 94 | return importBlock + '\n'; 95 | }; 96 | 97 | exports.cleanGeneratedCode = function(code) { 98 | var classCallCheckMethodMatcher = /function\s+_classCallCheck\(instance,\s+Constructor\)\s+\{\s+if\s+\(!\(instance\s+instanceof\s+Constructor\)\)\s+\{\s+throw\s+new\s+TypeError\("Cannot\s+call\s+a\s+class\s+as\s+a\s+function"\)\;\s+}\s+}/g; 99 | var classCallCheckInvocationMatcher = /_classCallCheck\(this,\s[_a-zA-z1-9]+\);/g 100 | 101 | return code.replace(classCallCheckMethodMatcher, '').replace(classCallCheckInvocationMatcher, ''); 102 | } 103 | -------------------------------------------------------------------------------- /src/dev.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var path = require('path'); 3 | var exec = require('child_process').exec; 4 | var gitPath = 'http://github.com/aurelia/'; 5 | var dependencyPath = 'jspm_packages/npm'; 6 | 7 | if(!('endsWith' in String.prototype)){ 8 | String.prototype.endsWith = function(suffix) { 9 | return this.indexOf(suffix, this.length - suffix.length) !== -1; 10 | }; 11 | } 12 | 13 | var mkdir = function(dir) { 14 | // making directory without exception if exists 15 | try { 16 | fs.mkdirSync(dir, 0755); 17 | } catch(e) { 18 | if(e.code != "EEXIST") { 19 | throw e; 20 | } 21 | } 22 | }; 23 | 24 | var copyDir = function(src, dest) { 25 | try{ 26 | mkdir(dest); 27 | var files = fs.readdirSync(src); 28 | for(var i = 0; i < files.length; i++) { 29 | var current = fs.lstatSync(path.join(src, files[i])); 30 | if(current.isDirectory()) { 31 | copyDir(path.join(src, files[i]), path.join(dest, files[i])); 32 | } else if(current.isSymbolicLink()) { 33 | var symlink = fs.readlinkSync(path.join(src, files[i])); 34 | fs.symlinkSync(symlink, path.join(dest, files[i])); 35 | } else { 36 | copy(path.join(src, files[i]), path.join(dest, files[i])); 37 | } 38 | } 39 | }catch(error){ 40 | console.log(error); 41 | } 42 | }; 43 | 44 | var copy = function(src, dest) { 45 | var oldFile = fs.createReadStream(src); 46 | var newFile = fs.createWriteStream(dest); 47 | oldFile.pipe(newFile); 48 | }; 49 | 50 | var findAureliaDirectories = function(name) { 51 | return name.startsWith('aurelia-'); 52 | }; 53 | 54 | var mapAureliaDirectories = function(name) { 55 | return [ 56 | '../' + name.substring(0, name.indexOf('@')).replace('aurelia-', ''), 57 | gitPath + name.substring(0, name.indexOf('@')).replace('aurelia-', '') + '.git' 58 | ]; 59 | }; 60 | 61 | var pullDevEnv = function(value) { 62 | mkdir(value[0]); 63 | exec("git clone " + value[1] + " " + value[0]); 64 | }; 65 | 66 | module.exports = { 67 | updateOwnDependenciesFromLocalRepositories:function(depth){ 68 | depth = (depth || 0) + 1; 69 | var levels = ''; 70 | 71 | for (var i = 0; i < depth; ++i) { 72 | levels += '../'; 73 | } 74 | 75 | fs.readdirSync(dependencyPath) 76 | .filter(function(name){ return name.startsWith('aurelia-') && name.endsWith('.js'); }) 77 | .map(function(name) { 78 | return [ 79 | levels + name.substring(0, name.indexOf('@')).replace('aurelia-', '') + '/dist/amd', 80 | dependencyPath + '/' + name.substring(0, name.indexOf('.js')) 81 | ]; 82 | }).forEach(function(value){ 83 | if (fs.existsSync(value[0])) { 84 | copyDir(value[0], value[1]); 85 | } 86 | }); 87 | }, 88 | buildDevEnv: function () { 89 | fs.readdirSync(dependencyPath) 90 | .filter(findAureliaDirectories) 91 | .map(mapAureliaDirectories) 92 | .forEach(function (value) { 93 | pullDevEnv(value); 94 | 95 | var normalizedPath = path.normalize(value[0]); 96 | exec("npm install", { 97 | cwd: normalizedPath 98 | }); 99 | exec("gulp build", { 100 | cwd: normalizedPath 101 | }); 102 | }); 103 | 104 | var sys = require('sys'); 105 | 106 | function puts(error, stdout, stderr) { sys.puts(stdout) } 107 | }, 108 | pullDevEnv: function () { 109 | fs.readdirSync(dependencyPath) 110 | .filter(findAureliaDirectories) 111 | .map(mapAureliaDirectories) 112 | .forEach(pullDevEnv); 113 | 114 | var sys = require('sys'); 115 | 116 | function puts(error, stdout, stderr) { sys.puts(stdout) } 117 | } 118 | }; 119 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "parser": "babel-eslint", // https://github.com/babel/babel-eslint 4 | "env": { // http://eslint.org/docs/user-guide/configuring.html#specifying-environments 5 | "browser": true, // browser global variables 6 | "node": true // Node.js global variables and Node.js-specific rules 7 | }, 8 | "parserOptions": { 9 | "ecmaVersion": 6, 10 | "sourceType": "module", 11 | "ecmaFeatures": { 12 | "legacyDecorators": true, 13 | "impliedStrict": true, 14 | "arrowFunctions": true, 15 | "blockBindings": true, 16 | "classes": true, 17 | "defaultParams": true, 18 | "destructuring": true, 19 | "forOf": true, 20 | "generators": false, 21 | "modules": true, 22 | "objectLiteralComputedProperties": true, 23 | "objectLiteralDuplicateProperties": false, 24 | "objectLiteralShorthandMethods": true, 25 | "objectLiteralShorthandProperties": true, 26 | "spread": true, 27 | "superInFunctions": true, 28 | "templateStrings": true, 29 | "jsx": false 30 | } 31 | }, 32 | "rules": { 33 | /** 34 | * Strict mode 35 | */ 36 | // babel inserts "use strict"; for us 37 | "strict": [2, "never"], // http://eslint.org/docs/rules/strict 38 | 39 | /** 40 | * ES6 41 | */ 42 | "no-var": 2, // http://eslint.org/docs/rules/no-var 43 | "prefer-const": 0, // http://eslint.org/docs/rules/prefer-const 44 | 45 | /** 46 | * Variables 47 | */ 48 | "no-shadow": 2, // http://eslint.org/docs/rules/no-shadow 49 | "no-shadow-restricted-names": 2, // http://eslint.org/docs/rules/no-shadow-restricted-names 50 | "no-unused-vars": [2, { // http://eslint.org/docs/rules/no-unused-vars 51 | "vars": "local", 52 | "args": "none" 53 | }], 54 | "no-use-before-define": 0, // http://eslint.org/docs/rules/no-use-before-define 55 | 56 | /** 57 | * Possible errors 58 | */ 59 | "comma-dangle": [2, "never"], // http://eslint.org/docs/rules/comma-dangle 60 | "no-cond-assign": [2, "always"], // http://eslint.org/docs/rules/no-cond-assign 61 | "no-console": 1, // http://eslint.org/docs/rules/no-console 62 | "no-debugger": 1, // http://eslint.org/docs/rules/no-debugger 63 | "no-alert": 1, // http://eslint.org/docs/rules/no-alert 64 | "no-constant-condition": 1, // http://eslint.org/docs/rules/no-constant-condition 65 | "no-dupe-keys": 2, // http://eslint.org/docs/rules/no-dupe-keys 66 | "no-duplicate-case": 2, // http://eslint.org/docs/rules/no-duplicate-case 67 | "no-empty": 2, // http://eslint.org/docs/rules/no-empty 68 | "no-ex-assign": 2, // http://eslint.org/docs/rules/no-ex-assign 69 | "no-extra-boolean-cast": 0, // http://eslint.org/docs/rules/no-extra-boolean-cast 70 | "no-extra-semi": 2, // http://eslint.org/docs/rules/no-extra-semi 71 | "no-func-assign": 2, // http://eslint.org/docs/rules/no-func-assign 72 | "no-inner-declarations": 2, // http://eslint.org/docs/rules/no-inner-declarations 73 | "no-invalid-regexp": 2, // http://eslint.org/docs/rules/no-invalid-regexp 74 | "no-irregular-whitespace": 2, // http://eslint.org/docs/rules/no-irregular-whitespace 75 | "no-obj-calls": 2, // http://eslint.org/docs/rules/no-obj-calls 76 | "no-sparse-arrays": 2, // http://eslint.org/docs/rules/no-sparse-arrays 77 | "no-unreachable": 2, // http://eslint.org/docs/rules/no-unreachable 78 | "use-isnan": 2, // http://eslint.org/docs/rules/use-isnan 79 | "block-scoped-var": 0, // http://eslint.org/docs/rules/block-scoped-var 80 | 81 | /** 82 | * Best practices 83 | */ 84 | "consistent-return": 0, // http://eslint.org/docs/rules/consistent-return 85 | "curly": [2, "multi-line"], // http://eslint.org/docs/rules/curly 86 | "default-case": 2, // http://eslint.org/docs/rules/default-case 87 | "dot-notation": [2, { // http://eslint.org/docs/rules/dot-notation 88 | "allowKeywords": true 89 | }], 90 | "eqeqeq": 2, // http://eslint.org/docs/rules/eqeqeq 91 | "guard-for-in": 0, // http://eslint.org/docs/rules/guard-for-in 92 | "no-caller": 2, // http://eslint.org/docs/rules/no-caller 93 | "no-else-return": 2, // http://eslint.org/docs/rules/no-else-return 94 | "no-eq-null": 2, // http://eslint.org/docs/rules/no-eq-null 95 | "no-eval": 2, // http://eslint.org/docs/rules/no-eval 96 | "no-extend-native": 2, // http://eslint.org/docs/rules/no-extend-native 97 | "no-extra-bind": 2, // http://eslint.org/docs/rules/no-extra-bind 98 | "no-fallthrough": 2, // http://eslint.org/docs/rules/no-fallthrough 99 | "no-floating-decimal": 2, // http://eslint.org/docs/rules/no-floating-decimal 100 | "no-implied-eval": 2, // http://eslint.org/docs/rules/no-implied-eval 101 | "no-lone-blocks": 2, // http://eslint.org/docs/rules/no-lone-blocks 102 | "no-loop-func": 2, // http://eslint.org/docs/rules/no-loop-func 103 | "no-multi-str": 2, // http://eslint.org/docs/rules/no-multi-str 104 | "no-native-reassign": 2, // http://eslint.org/docs/rules/no-native-reassign 105 | "no-new": 2, // http://eslint.org/docs/rules/no-new 106 | "no-new-func": 2, // http://eslint.org/docs/rules/no-new-func 107 | "no-new-wrappers": 2, // http://eslint.org/docs/rules/no-new-wrappers 108 | "no-octal": 2, // http://eslint.org/docs/rules/no-octal 109 | "no-octal-escape": 2, // http://eslint.org/docs/rules/no-octal-escape 110 | "no-param-reassign": 0, // http://eslint.org/docs/rules/no-param-reassign 111 | "no-proto": 2, // http://eslint.org/docs/rules/no-proto 112 | "no-redeclare": 2, // http://eslint.org/docs/rules/no-redeclare 113 | // "no-return-assign": 2, // http://eslint.org/docs/rules/no-return-assign 114 | "no-script-url": 2, // http://eslint.org/docs/rules/no-script-url 115 | "no-self-compare": 2, // http://eslint.org/docs/rules/no-self-compare 116 | "no-sequences": 2, // http://eslint.org/docs/rules/no-sequences 117 | "no-throw-literal": 2, // http://eslint.org/docs/rules/no-throw-literal 118 | "no-undef": 2, // http://eslint.org/docs/rules/no-undef 119 | "no-with": 2, // http://eslint.org/docs/rules/no-with 120 | "radix": 2, // http://eslint.org/docs/rules/radix 121 | "vars-on-top": 2, // http://eslint.org/docs/rules/vars-on-top 122 | "wrap-iife": [2, "any"], // http://eslint.org/docs/rules/wrap-iife 123 | "yoda": 2, // http://eslint.org/docs/rules/yoda 124 | 125 | /** 126 | * Style 127 | */ 128 | "indent": [2, 2], // http://eslint.org/docs/rules/indent 129 | "brace-style": [2, // http://eslint.org/docs/rules/brace-style 130 | "1tbs", { 131 | "allowSingleLine": true 132 | }], 133 | "quotes": [ 134 | 2, "single", "avoid-escape" // http://eslint.org/docs/rules/quotes 135 | ], 136 | "camelcase": [2, { // http://eslint.org/docs/rules/camelcase 137 | "properties": "never" 138 | }], 139 | "comma-spacing": [2, { // http://eslint.org/docs/rules/comma-spacing 140 | "before": false, 141 | "after": true 142 | }], 143 | "comma-style": [2, "last"], // http://eslint.org/docs/rules/comma-style 144 | "eol-last": 2, // http://eslint.org/docs/rules/eol-last 145 | "func-names": 0, // http://eslint.org/docs/rules/func-names 146 | "key-spacing": [2, { // http://eslint.org/docs/rules/key-spacing 147 | "beforeColon": false, 148 | "afterColon": true 149 | }], 150 | "new-cap": [2, { // http://eslint.org/docs/rules/new-cap 151 | "newIsCap": true 152 | }], 153 | "no-multiple-empty-lines": [2, { // http://eslint.org/docs/rules/no-multiple-empty-lines 154 | "max": 2 155 | }], 156 | "no-nested-ternary": 2, // http://eslint.org/docs/rules/no-nested-ternary 157 | "no-new-object": 2, // http://eslint.org/docs/rules/no-new-object 158 | "no-spaced-func": 2, // http://eslint.org/docs/rules/no-spaced-func 159 | "no-trailing-spaces": 2, // http://eslint.org/docs/rules/no-trailing-spaces 160 | "no-extra-parens": [2, "functions"], // http://eslint.org/docs/rules/no-extra-parens 161 | "no-underscore-dangle": 0, // http://eslint.org/docs/rules/no-underscore-dangle 162 | "one-var": [2, "never"], // http://eslint.org/docs/rules/one-var 163 | "padded-blocks": [2, "never"], // http://eslint.org/docs/rules/padded-blocks 164 | "semi": [2, "always"], // http://eslint.org/docs/rules/semi 165 | "semi-spacing": [2, { // http://eslint.org/docs/rules/semi-spacing 166 | "before": false, 167 | "after": true 168 | }], 169 | "keyword-spacing": [2, { // http://eslint.org/docs/rules/keyword-spacing 170 | "before": true, 171 | "after": true 172 | }], 173 | "space-before-blocks": 2, // http://eslint.org/docs/rules/space-before-blocks 174 | "space-before-function-paren": [2, "never"], // http://eslint.org/docs/rules/space-before-function-paren 175 | "space-infix-ops": 2, // http://eslint.org/docs/rules/space-infix-ops 176 | "spaced-comment": [0, "always", { // http://eslint.org/docs/rules/spaced-comment 177 | "exceptions": ["*"], 178 | "markers": ["*"] 179 | }] 180 | } 181 | } 182 | --------------------------------------------------------------------------------