├── fixtures ├── a.txt ├── b.txt ├── c.txt ├── a.hbs ├── b.hbs └── c.hbs ├── .gitattributes ├── .travis.yml ├── .gitignore ├── .editorconfig ├── .verb.md ├── assemblefile.js ├── LICENSE ├── package.json ├── index.js ├── README.md ├── test.js └── .eslintrc.json /fixtures/a.txt: -------------------------------------------------------------------------------- 1 | This is AAA! -------------------------------------------------------------------------------- /fixtures/b.txt: -------------------------------------------------------------------------------- 1 | This is BBB! -------------------------------------------------------------------------------- /fixtures/c.txt: -------------------------------------------------------------------------------- 1 | This is CCC! -------------------------------------------------------------------------------- /fixtures/a.hbs: -------------------------------------------------------------------------------- 1 | This is {{name}}! -------------------------------------------------------------------------------- /fixtures/b.hbs: -------------------------------------------------------------------------------- 1 | This is {{name}}! -------------------------------------------------------------------------------- /fixtures/c.hbs: -------------------------------------------------------------------------------- 1 | This is {{name}}! -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Enforce Unix newlines 2 | * text eol=lf 3 | 4 | # binaries 5 | *.ai binary 6 | *.psd binary 7 | *.jpg binary 8 | *.gif binary 9 | *.png binary 10 | *.jpeg binary 11 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | node_js: 4 | - '5' 5 | - '4' 6 | - '0.12' 7 | - '0.10' 8 | matrix: 9 | fast_finish: true 10 | allow_failures: 11 | - node_js: '0.10' 12 | - node_js: '0.12' 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # always ignore files 2 | *.DS_Store 3 | *.sublime-* 4 | 5 | # test related, or directories generated by tests 6 | test/actual 7 | actual 8 | coverage 9 | 10 | # npm 11 | node_modules 12 | npm-debug.log 13 | 14 | # misc 15 | _gh_pages 16 | benchmark 17 | bower_components 18 | vendor 19 | temp 20 | tmp 21 | TODO.md 22 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | end_of_line = lf 7 | charset = utf-8 8 | indent_size = 2 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | insert_final_newline = false 15 | 16 | [**/{actual,fixtures,expected}/**] 17 | trim_trailing_whitespace = false 18 | insert_final_newline = false 19 | 20 | [**/templates/**] 21 | trim_trailing_whitespace = false 22 | insert_final_newline = false 23 | -------------------------------------------------------------------------------- /.verb.md: -------------------------------------------------------------------------------- 1 | **Example** 2 | 3 | ![assemble-select-files](https://cloud.githubusercontent.com/assets/383994/15121181/49828aec-15e7-11e6-9d7d-9f388f2666e3.gif) 4 | 5 | ## Usage 6 | 7 | ```js 8 | var select = require('{%= name %}'); 9 | var assemble = require('assemble'); 10 | var app = assemble(); 11 | 12 | // register the plugin 13 | app.use(select()); 14 | ``` 15 | 16 | **Example usage** 17 | 18 | ```js 19 | // create a collection 20 | app.create('pages'); 21 | 22 | // register an engine for rendering ".hbs" files 23 | app.engine('hbs', require('engine-handlebars')); 24 | 25 | // ask the user which files they want to render and write to the file system 26 | app.selectFiles('*.hbs', function(err, files) { 27 | // `files` is the array of rendered files 28 | console.log(files); 29 | }); 30 | ``` 31 | -------------------------------------------------------------------------------- /assemblefile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var path = require('path'); 4 | var assemble = require('assemble'); 5 | var questions = require('base-questions'); 6 | var conflicts = require('base-fs-conflicts'); 7 | var rename = require('base-fs-rename'); 8 | var select = require('./'); 9 | 10 | // register plugins 11 | var app = assemble() 12 | .use(questions()) 13 | .use(conflicts()) 14 | .use(rename()) 15 | .use(select()) 16 | 17 | app.preRender(/./, function(file, next) { 18 | file.data.name = file.stem.toUpperCase(); 19 | next(); 20 | }); 21 | 22 | // engine 23 | app.engine('hbs', require('engine-handlebars')); 24 | 25 | // options 26 | app.option({ 27 | engine: 'hbs', 28 | dest: 'actual', 29 | flatten: true, 30 | renameKey: function(key, file) { 31 | return file ? file.basename : path.basename(key); 32 | } 33 | }); 34 | 35 | // example task 36 | app.task('default', function(cb) { 37 | app.selectFiles('fixtures/*.hbs', cb); 38 | }); 39 | 40 | module.exports = app; 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016, Jon Schlinkert. 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 13 | all 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 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "assemble-select-files", 3 | "description": "Assemble plugin that adds a `.selectFiles` method to the instance, for reading in a glob of files and prompting the user to select the files they want to write to the file system.", 4 | "version": "0.1.0", 5 | "homepage": "https://github.com/assemble/assemble-select-files", 6 | "author": "Jon Schlinkert (https://github.com/jonschlinkert)", 7 | "repository": "assemble/assemble-select-files", 8 | "bugs": { 9 | "url": "https://github.com/assemble/assemble-select-files/issues" 10 | }, 11 | "license": "MIT", 12 | "files": [ 13 | "index.js" 14 | ], 15 | "main": "index.js", 16 | "engines": { 17 | "node": ">=0.10.0" 18 | }, 19 | "scripts": { 20 | "test": "mocha" 21 | }, 22 | "dependencies": { 23 | "assemble-select-views": "^0.1.5", 24 | "extend-shallow": "^2.0.1" 25 | }, 26 | "devDependencies": { 27 | "assemble": "^0.11.0", 28 | "assemble-core": "^0.17.2", 29 | "assemble-loader": "^0.4.0", 30 | "base-fs-conflicts": "^0.1.6", 31 | "base-fs-rename": "^0.1.2", 32 | "base-questions": "^0.6.0", 33 | "delete": "^0.3.2", 34 | "engine-handlebars": "^0.8.0", 35 | "fs-exists-sync": "^0.1.0", 36 | "gulp-format-md": "^0.1.9", 37 | "mocha": "^2.4.5" 38 | }, 39 | "keywords": [ 40 | "assemble", 41 | "files", 42 | "select" 43 | ], 44 | "verb": { 45 | "toc": false, 46 | "layout": "default", 47 | "tasks": [ 48 | "readme" 49 | ], 50 | "plugins": [ 51 | "gulp-format-md" 52 | ], 53 | "related": { 54 | "highlight": "assemble-select-views", 55 | "list": [ 56 | "assemble", 57 | "templates", 58 | "assemble-select-views", 59 | "generate" 60 | ] 61 | }, 62 | "reflinks": [ 63 | "verb" 64 | ], 65 | "lint": { 66 | "reflinks": true 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var path = require('path'); 4 | var extend = require('extend-shallow'); 5 | var select = require('assemble-select-views'); 6 | var loader = require('assemble-loader'); 7 | 8 | module.exports = function(config) { 9 | config = config || {}; 10 | 11 | return function plugin(app) { 12 | if (!isValidInstance(this)) return; 13 | 14 | 15 | this.use(select()); 16 | this.use(loader()); 17 | 18 | this.define('selectFiles', function(patterns, options, cb) { 19 | if (typeof options === 'function') { 20 | cb = options; 21 | options = {}; 22 | } 23 | 24 | var name = 'select_file'; 25 | var defaults = {cwd: this.cwd, message: 'Which files to you want to render?'}; 26 | var opts = extend(defaults, this.options, config, options); 27 | opts.dest = path.resolve(opts.cwd, opts.dest || ''); 28 | 29 | if (typeof opts.renameKey !== 'function') { 30 | opts.renameKey = function(key, file) { 31 | return file ? file.basename : path.basename(key); 32 | }; 33 | } 34 | 35 | if (typeof this.question !== 'function') { 36 | cb(new Error('expected the base-questions plugin to be registered')); 37 | return; 38 | } 39 | 40 | // create a temporary view collection 41 | this.create(name, opts); 42 | this[name].load(patterns, opts); 43 | 44 | if (typeof opts.selectFiles !== 'undefined') { 45 | opts.selectViews = opts.selectFiles; 46 | } 47 | 48 | return this.selectViews(name, opts, function(err, views) { 49 | if (err) return cb(err); 50 | 51 | // clean up temporary collection 52 | app.del('views.' + name); 53 | app.del(name); 54 | 55 | // pass rendered views to callback 56 | cb(null, views); 57 | }); 58 | }); 59 | 60 | return plugin; 61 | }; 62 | }; 63 | 64 | function isValidInstance(app) { 65 | if (!app.isApp && !app.isGenerator && !app.isViews) { 66 | return false; 67 | } 68 | if (app.isRegistered('assemble-select-files')) { 69 | return false; 70 | } 71 | return true; 72 | } 73 | 74 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # assemble-select-files [![NPM version](https://img.shields.io/npm/v/assemble-select-files.svg?style=flat)](https://www.npmjs.com/package/assemble-select-files) [![NPM downloads](https://img.shields.io/npm/dm/assemble-select-files.svg?style=flat)](https://npmjs.org/package/assemble-select-files) [![Build Status](https://img.shields.io/travis/assemble/assemble-select-files.svg?style=flat)](https://travis-ci.org/assemble/assemble-select-files) 2 | 3 | Assemble plugin that adds a `.selectFiles` method to the instance, for reading in a glob of files and prompting the user to select the files they want to write to the file system. 4 | 5 | You might also be interested in [assemble-select-views](https://github.com/assemble/assemble-select-views). 6 | 7 | ## Install 8 | 9 | Install with [npm](https://www.npmjs.com/): 10 | 11 | ```sh 12 | $ npm install assemble-select-files --save 13 | ``` 14 | 15 | **Example** 16 | 17 | ![assemble-select-files](https://cloud.githubusercontent.com/assets/383994/15121181/49828aec-15e7-11e6-9d7d-9f388f2666e3.gif) 18 | 19 | ## Usage 20 | 21 | ```js 22 | var select = require('assemble-select-files'); 23 | var assemble = require('assemble'); 24 | var app = assemble(); 25 | 26 | // register the plugin 27 | app.use(select()); 28 | ``` 29 | 30 | **Example usage** 31 | 32 | ```js 33 | // create a collection 34 | app.create('pages'); 35 | 36 | // register an engine for rendering ".hbs" files 37 | app.engine('hbs', require('engine-handlebars')); 38 | 39 | // ask the user which files they want to render and write to the file system 40 | app.selectFiles('*.hbs', function(err, files) { 41 | // `files` is the array of rendered files 42 | console.log(files); 43 | }); 44 | ``` 45 | 46 | ## Related projects 47 | 48 | You might also be interested in these projects: 49 | 50 | * [assemble-select-views](https://www.npmjs.com/package/assemble-select-views): Assemble plugin that adds a `.selectViews` method to the instance, for prompting the user to… [more](https://www.npmjs.com/package/assemble-select-views) | [homepage](https://github.com/assemble/assemble-select-views) 51 | * [assemble](https://www.npmjs.com/package/assemble): Assemble is a powerful, extendable and easy to use static site generator for node.js. Used… [more](https://www.npmjs.com/package/assemble) | [homepage](https://github.com/assemble/assemble) 52 | * [generate](https://www.npmjs.com/package/generate): Fast, composable, highly extendable project generator with a user-friendly and expressive API. | [homepage](https://github.com/generate/generate) 53 | * [templates](https://www.npmjs.com/package/templates): System for creating and managing template collections, and rendering templates with any node.js template engine.… [more](https://www.npmjs.com/package/templates) | [homepage](https://github.com/jonschlinkert/templates) 54 | 55 | ## Contributing 56 | 57 | Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/assemble/assemble-select-files/issues/new). 58 | 59 | ## Building docs 60 | 61 | Generate readme and API documentation with [verb](https://github.com/verbose/verb): 62 | 63 | ```sh 64 | $ npm install verb && npm run docs 65 | ``` 66 | 67 | Or, if [verb](https://github.com/verbose/verb) is installed globally: 68 | 69 | ```sh 70 | $ verb 71 | ``` 72 | 73 | ## Running tests 74 | 75 | Install dev dependencies: 76 | 77 | ```sh 78 | $ npm install -d && npm test 79 | ``` 80 | 81 | ## Author 82 | 83 | **Jon Schlinkert** 84 | 85 | * [github/jonschlinkert](https://github.com/jonschlinkert) 86 | * [twitter/jonschlinkert](http://twitter.com/jonschlinkert) 87 | 88 | ## License 89 | 90 | Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). 91 | Released under the [MIT license](https://github.com/assemble/assemble-select-files/blob/master/LICENSE). 92 | 93 | *** 94 | 95 | _This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on May 09, 2016._ -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('mocha'); 4 | var assert = require('assert'); 5 | var assemble = require('assemble-core'); 6 | var questions = require('base-questions'); 7 | var conflicts = require('base-fs-conflicts'); 8 | var rename = require('base-fs-rename'); 9 | var exists = require('fs-exists-sync'); 10 | var del = require('delete'); 11 | var select = require('./'); 12 | var app; 13 | 14 | describe('assemble-select-files', function() { 15 | describe('module', function() { 16 | it('should export a function', function() { 17 | assert.equal(typeof select, 'function'); 18 | }); 19 | }); 20 | 21 | describe('plugin', function() { 22 | it('should only register the plugin once', function(cb) { 23 | var count = 0; 24 | app = assemble(); 25 | app.on('plugin', function(name) { 26 | if (name === 'assemble-select-files') { 27 | count++; 28 | } 29 | }); 30 | app.use(select()); 31 | app.use(select()); 32 | app.use(select()); 33 | assert.equal(count, 1); 34 | cb(); 35 | }); 36 | }); 37 | 38 | describe('errors', function() { 39 | beforeEach(function() { 40 | app = assemble(); 41 | app.use(select()); 42 | app.create('pages'); 43 | }); 44 | 45 | it('should throw an error when base-questions is not registered', function(cb) { 46 | app.use(conflicts()); 47 | app.use(rename()); 48 | 49 | app.selectFiles('fixtures/*.hbs', function(err, views) { 50 | assert(err); 51 | assert.equal(err.message, 'expected the base-questions plugin to be registered'); 52 | cb(); 53 | }); 54 | }); 55 | 56 | it('should throw an error when base-fs-conflicts is not registered', function(cb) { 57 | app.use(questions()); 58 | app.use(rename()); 59 | 60 | app.selectFiles('fixtures/*.hbs', function(err, views) { 61 | assert(err); 62 | assert.equal(err.message, 'expected the base-fs-conflicts plugin to be registered'); 63 | cb(); 64 | }); 65 | }); 66 | 67 | it('should throw an error when base-fs-rename is not registered', function(cb) { 68 | app.use(questions()); 69 | app.use(conflicts()); 70 | 71 | app.selectFiles('fixtures/*.hbs', function(err, views) { 72 | assert(err); 73 | assert.equal(err.message, 'expected the base-fs-rename plugin to be registered'); 74 | cb(); 75 | }); 76 | }); 77 | 78 | it('should throw an error when base-fs-rename is not registered', function(cb) { 79 | app.use(questions()); 80 | app.use(conflicts()); 81 | 82 | app.selectFiles('fixtures/*.hbs', function(err, views) { 83 | assert(err); 84 | assert.equal(err.message, 'expected the base-fs-rename plugin to be registered'); 85 | cb(); 86 | }); 87 | }); 88 | }); 89 | 90 | describe('plugin', function() { 91 | this.timeout(10000); 92 | 93 | beforeEach(function() { 94 | app = assemble(); 95 | app.use(questions()); 96 | app.use(conflicts()); 97 | app.use(rename()); 98 | app.use(select()); 99 | app.create('pages'); 100 | }); 101 | 102 | afterEach(function(cb) { 103 | del('actual', cb); 104 | }); 105 | 106 | it('should render views specified on the `selectFiles` option', function(cb) { 107 | app.engine('hbs', require('engine-handlebars')); 108 | 109 | app.data({name: 'blah'}); 110 | app.option('dest', 'actual'); 111 | app.option('selectFiles', ['a.hbs', 'c.hbs']); 112 | app.option('flatten', true); 113 | 114 | app.selectFiles('fixtures/*.hbs', function(err, views) { 115 | if (err) return cb(err); 116 | assert(exists('actual/a.hbs')); 117 | assert(exists('actual/c.hbs')); 118 | cb(); 119 | }); 120 | }); 121 | }); 122 | }); 123 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "ecmaFeatures": { 3 | "modules": true, 4 | "experimentalObjectRestSpread": true 5 | }, 6 | "env": { 7 | "browser": false, 8 | "es6": true, 9 | "node": true, 10 | "mocha": true 11 | }, 12 | "globals": { 13 | "document": false, 14 | "navigator": false, 15 | "window": false 16 | }, 17 | "rules": { 18 | "accessor-pairs": 2, 19 | "arrow-spacing": [ 20 | 2, 21 | { 22 | "before": true, 23 | "after": true 24 | } 25 | ], 26 | "block-spacing": [ 27 | 2, 28 | "always" 29 | ], 30 | "brace-style": [ 31 | 2, 32 | "1tbs", 33 | { 34 | "allowSingleLine": true 35 | } 36 | ], 37 | "comma-dangle": [ 38 | 2, 39 | "never" 40 | ], 41 | "comma-spacing": [ 42 | 2, 43 | { 44 | "before": false, 45 | "after": true 46 | } 47 | ], 48 | "comma-style": [ 49 | 2, 50 | "last" 51 | ], 52 | "constructor-super": 2, 53 | "curly": [ 54 | 2, 55 | "multi-line" 56 | ], 57 | "dot-location": [ 58 | 2, 59 | "property" 60 | ], 61 | "eol-last": 2, 62 | "eqeqeq": [ 63 | 2, 64 | "allow-null" 65 | ], 66 | "generator-star-spacing": [ 67 | 2, 68 | { 69 | "before": true, 70 | "after": true 71 | } 72 | ], 73 | "handle-callback-err": [ 74 | 2, 75 | "^(err|error)$" 76 | ], 77 | "indent": [ 78 | 2, 79 | 2, 80 | { 81 | "SwitchCase": 1 82 | } 83 | ], 84 | "key-spacing": [ 85 | 2, 86 | { 87 | "beforeColon": false, 88 | "afterColon": true 89 | } 90 | ], 91 | "keyword-spacing": [ 92 | 2, 93 | { 94 | "before": true, 95 | "after": true 96 | } 97 | ], 98 | "new-cap": [ 99 | 2, 100 | { 101 | "newIsCap": true, 102 | "capIsNew": false 103 | } 104 | ], 105 | "new-parens": 2, 106 | "no-array-constructor": 2, 107 | "no-caller": 2, 108 | "no-class-assign": 2, 109 | "no-cond-assign": 2, 110 | "no-const-assign": 2, 111 | "no-control-regex": 2, 112 | "no-debugger": 2, 113 | "no-delete-var": 2, 114 | "no-dupe-args": 2, 115 | "no-dupe-class-members": 2, 116 | "no-dupe-keys": 2, 117 | "no-duplicate-case": 2, 118 | "no-empty-character-class": 2, 119 | "no-eval": 2, 120 | "no-ex-assign": 2, 121 | "no-extend-native": 2, 122 | "no-extra-bind": 2, 123 | "no-extra-boolean-cast": 2, 124 | "no-extra-parens": [ 125 | 2, 126 | "functions" 127 | ], 128 | "no-fallthrough": 2, 129 | "no-floating-decimal": 2, 130 | "no-func-assign": 2, 131 | "no-implied-eval": 2, 132 | "no-inner-declarations": [ 133 | 2, 134 | "functions" 135 | ], 136 | "no-invalid-regexp": 2, 137 | "no-irregular-whitespace": 2, 138 | "no-iterator": 2, 139 | "no-label-var": 2, 140 | "no-labels": 2, 141 | "no-lone-blocks": 2, 142 | "no-mixed-spaces-and-tabs": 2, 143 | "no-multi-spaces": 2, 144 | "no-multi-str": 2, 145 | "no-multiple-empty-lines": [ 146 | 2, 147 | { 148 | "max": 1 149 | } 150 | ], 151 | "no-native-reassign": 0, 152 | "no-negated-in-lhs": 2, 153 | "no-new": 2, 154 | "no-new-func": 2, 155 | "no-new-object": 2, 156 | "no-new-require": 2, 157 | "no-new-wrappers": 2, 158 | "no-obj-calls": 2, 159 | "no-octal": 2, 160 | "no-octal-escape": 2, 161 | "no-proto": 0, 162 | "no-redeclare": 2, 163 | "no-regex-spaces": 2, 164 | "no-return-assign": 2, 165 | "no-self-compare": 2, 166 | "no-sequences": 2, 167 | "no-shadow-restricted-names": 2, 168 | "no-spaced-func": 2, 169 | "no-sparse-arrays": 2, 170 | "no-this-before-super": 2, 171 | "no-throw-literal": 2, 172 | "no-trailing-spaces": 0, 173 | "no-undef": 2, 174 | "no-undef-init": 2, 175 | "no-unexpected-multiline": 2, 176 | "no-unneeded-ternary": [ 177 | 2, 178 | { 179 | "defaultAssignment": false 180 | } 181 | ], 182 | "no-unreachable": 2, 183 | "no-unused-vars": [ 184 | 2, 185 | { 186 | "vars": "all", 187 | "args": "none" 188 | } 189 | ], 190 | "no-useless-call": 0, 191 | "no-with": 2, 192 | "one-var": [ 193 | 0, 194 | { 195 | "initialized": "never" 196 | } 197 | ], 198 | "operator-linebreak": [ 199 | 0, 200 | "after", 201 | { 202 | "overrides": { 203 | "?": "before", 204 | ":": "before" 205 | } 206 | } 207 | ], 208 | "padded-blocks": [ 209 | 0, 210 | "never" 211 | ], 212 | "quotes": [ 213 | 2, 214 | "single", 215 | "avoid-escape" 216 | ], 217 | "radix": 2, 218 | "semi": [ 219 | 2, 220 | "always" 221 | ], 222 | "semi-spacing": [ 223 | 2, 224 | { 225 | "before": false, 226 | "after": true 227 | } 228 | ], 229 | "space-before-blocks": [ 230 | 2, 231 | "always" 232 | ], 233 | "space-before-function-paren": [ 234 | 2, 235 | "never" 236 | ], 237 | "space-in-parens": [ 238 | 2, 239 | "never" 240 | ], 241 | "space-infix-ops": 2, 242 | "space-unary-ops": [ 243 | 2, 244 | { 245 | "words": true, 246 | "nonwords": false 247 | } 248 | ], 249 | "spaced-comment": [ 250 | 0, 251 | "always", 252 | { 253 | "markers": [ 254 | "global", 255 | "globals", 256 | "eslint", 257 | "eslint-disable", 258 | "*package", 259 | "!", 260 | "," 261 | ] 262 | } 263 | ], 264 | "use-isnan": 2, 265 | "valid-typeof": 2, 266 | "wrap-iife": [ 267 | 2, 268 | "any" 269 | ], 270 | "yoda": [ 271 | 2, 272 | "never" 273 | ] 274 | } 275 | } 276 | --------------------------------------------------------------------------------