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

Commit

Permalink
[changed] JSLint and SASSLint (also affects JS and SASS) cons…
Browse files Browse the repository at this point in the history
…tructors now both accept a single argument - `configFile`, which is a path to the respective configuration files of `ESLint` and `stylelint`. They both support extends, so any other configuration options are redundant.
  • Loading branch information
thealjey committed Jan 26, 2017
1 parent b4574ba commit 053de5d
Show file tree
Hide file tree
Showing 22 changed files with 149 additions and 123 deletions.
25 changes: 13 additions & 12 deletions docs/JS.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h2>



<h4 class="name" id="JS"><span class="type-signature"></span>new JS<span class="signature">(compress<span class="signature-attributes">opt</span>, lintRules<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<h4 class="name" id="JS"><span class="type-signature"></span>new JS<span class="signature">(compress<span class="signature-attributes">opt</span>, configFile<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>



Expand All @@ -65,7 +65,7 @@ <h4 class="name" id="JS"><span class="type-signature"></span>new JS<span class="

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="JS.js.html">JS.js</a>, <a href="JS.js.html#line10">line 10</a>
<a href="JS.js.html">JS.js</a>, <a href="JS.js.html#line13">line 13</a>
</li></ul></dd>


Expand Down Expand Up @@ -189,20 +189,21 @@ <h5>Parameters:</h5>
</td>


<td class="description last"><p>if true <code>Compiler#save</code> will gzip compress the data in production mode</p></td>
<td class="description last"><p>if true <code>Compiler#save</code> will gzip compress the data in
production mode</p></td>
</tr>



<tr>

<td class="name"><code>lintRules</code></td>
<td class="name"><code>configFile</code></td>


<td class="type">


<span class="param-type">Object</span>
<span class="param-type">string</span>



Expand All @@ -223,12 +224,12 @@ <h5>Parameters:</h5>

<td class="default">

<code>{}</code>
<code>"webcompiler/.eslintrc.yaml"</code>

</td>


<td class="description last"><p>allows to override the default linting rules</p></td>
<td class="description last"><p>path to the ESLint configuration file</p></td>
</tr>


Expand Down Expand Up @@ -279,7 +280,7 @@ <h4 class="name" id="compiler"><span class="type-signature"></span>compiler<span

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="JS.js.html">JS.js</a>, <a href="JS.js.html#line26">line 26</a>
<a href="JS.js.html">JS.js</a>, <a href="JS.js.html#line30">line 30</a>
</li></ul></dd>


Expand Down Expand Up @@ -362,7 +363,7 @@ <h4 class="name" id=".typecheck"><span class="type-signature">(static) </span>ty

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="JS.js.html">JS.js</a>, <a href="JS.js.html#line52">line 52</a>
<a href="JS.js.html">JS.js</a>, <a href="JS.js.html#line56">line 56</a>
</li></ul></dd>


Expand Down Expand Up @@ -502,7 +503,7 @@ <h4 class="name" id="be"><span class="type-signature"></span>be<span class="sign

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="JS.js.html">JS.js</a>, <a href="JS.js.html#line124">line 124</a>
<a href="JS.js.html">JS.js</a>, <a href="JS.js.html#line128">line 128</a>
</li></ul></dd>


Expand Down Expand Up @@ -789,7 +790,7 @@ <h4 class="name" id="fe"><span class="type-signature"></span>fe<span class="sign

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="JS.js.html">JS.js</a>, <a href="JS.js.html#line146">line 146</a>
<a href="JS.js.html">JS.js</a>, <a href="JS.js.html#line150">line 150</a>
</li></ul></dd>


Expand Down Expand Up @@ -1076,7 +1077,7 @@ <h4 class="name" id="lint"><span class="type-signature"></span>lint<span class="

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="JS.js.html">JS.js</a>, <a href="JS.js.html#line81">line 81</a>
<a href="JS.js.html">JS.js</a>, <a href="JS.js.html#line85">line 85</a>
</li></ul></dd>


Expand Down
12 changes: 8 additions & 4 deletions docs/JS.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,17 @@ <h1 class="page-title">JS.js</h1>
import noop from 'lodash/noop';
import {logError, logLintingErrors} from './logger';
import {findBinary} from './findBinary';
import {join} from 'path';

const defaultConfigFile = join(__dirname, '..', '.eslintrc.yaml');

/**
* JavaScript compilation tools
*
* @class JS
* @param {boolean} [compress=true] - if true `Compiler#save` will gzip compress the data in production mode
* @param {Object} [lintRules={}] - allows to override the default linting rules
* @param {boolean} [compress=true] - if true `Compiler#save` will gzip compress the data in
* production mode
* @param {string} [configFile="webcompiler/.eslintrc.yaml"] - path to the ESLint configuration file
* @example
* import {JS} from 'webcompiler';
* // or - import {JS} from 'webcompiler/lib/JS';
Expand Down Expand Up @@ -82,10 +86,10 @@ <h1 class="page-title">JS.js</h1>
linter: JSLint;

/* eslint-disable require-jsdoc */
constructor(compress: boolean = true, lintRules: Object = {}) {
constructor(compress: boolean = true, configFile: string = defaultConfigFile) {
/* eslint-enable require-jsdoc */
this.compiler = new JSCompiler(compress);
this.linter = new JSLint(lintRules);
this.linter = new JSLint(configFile);
}

/**
Expand Down
10 changes: 5 additions & 5 deletions docs/JSLint.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h2>



<h4 class="name" id="JSLint"><span class="type-signature"></span>new JSLint<span class="signature">(rules<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<h4 class="name" id="JSLint"><span class="type-signature"></span>new JSLint<span class="signature">(configFile<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>



Expand Down Expand Up @@ -165,13 +165,13 @@ <h5>Parameters:</h5>

<tr>

<td class="name"><code>rules</code></td>
<td class="name"><code>configFile</code></td>


<td class="type">


<span class="param-type">Object</span>
<span class="param-type">string</span>



Expand All @@ -192,12 +192,12 @@ <h5>Parameters:</h5>

<td class="default">

<code>{}</code>
<code>"webcompiler/.eslintrc.yaml"</code>

</td>


<td class="description last"><p>an object that lets you override default linting rules</p></td>
<td class="description last"><p>path to the ESLint configuration file</p></td>
</tr>


Expand Down
8 changes: 4 additions & 4 deletions docs/JSLint.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ <h1 class="page-title">JSLint.js</h1>

/* eslint-disable lodash/prefer-map */

const configFile = join(__dirname, '..', '.eslintrc.yaml');
const defaultConfigFile = join(__dirname, '..', '.eslintrc.yaml');

/**
* A JavaScript linter
*
* @class JSLint
* @param {Object} [rules={}] - an object that lets you override default linting rules
* @param {string} [configFile="webcompiler/.eslintrc.yaml"] - path to the ESLint configuration file
* @see {@link http://eslint.org/ ESLint}
* @example
* import {JSLint} from 'webcompiler';
Expand All @@ -76,9 +76,9 @@ <h1 class="page-title">JSLint.js</h1>
linter: CLIEngine;

/* eslint-disable require-jsdoc */
constructor(rules: Object = {}) {
constructor(configFile: string = defaultConfigFile) {
/* eslint-enable require-jsdoc */
this.linter = new CLIEngine({configFile, rules});
this.linter = new CLIEngine({configFile});
}

/**
Expand Down
26 changes: 13 additions & 13 deletions docs/SASS.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h2>



<h4 class="name" id="SASS"><span class="type-signature"></span>new SASS<span class="signature">(compress<span class="signature-attributes">opt</span>, includePaths<span class="signature-attributes">opt</span>, configOverrides<span class="signature-attributes">opt</span>, importOnceOptions<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<h4 class="name" id="SASS"><span class="type-signature"></span>new SASS<span class="signature">(compress<span class="signature-attributes">opt</span>, includePaths<span class="signature-attributes">opt</span>, configFile<span class="signature-attributes">opt</span>, importOnceOptions<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>



Expand All @@ -65,7 +65,7 @@ <h4 class="name" id="SASS"><span class="type-signature"></span>new SASS<span cla

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="SASS.js.html">SASS.js</a>, <a href="SASS.js.html#line8">line 8</a>
<a href="SASS.js.html">SASS.js</a>, <a href="SASS.js.html#line11">line 11</a>
</li></ul></dd>


Expand Down Expand Up @@ -198,8 +198,8 @@ <h5>Parameters:</h5>
</td>


<td class="description last"><p>if true <code>Compiler#save</code> will gzip compress the data in production
mode</p></td>
<td class="description last"><p>if true <code>Compiler#save</code> will gzip compress the
data in production mode</p></td>
</tr>


Expand Down Expand Up @@ -245,13 +245,13 @@ <h5>Parameters:</h5>

<tr>

<td class="name"><code>configOverrides</code></td>
<td class="name"><code>configFile</code></td>


<td class="type">


<span class="param-type">Object</span>
<span class="param-type">string</span>



Expand All @@ -272,12 +272,12 @@ <h5>Parameters:</h5>

<td class="default">

<code>{}</code>
<code>"webcompiler/.stylelintrc.yaml"</code>

</td>


<td class="description last"><p>an object that lets you override the default linting configuration</p></td>
<td class="description last"><p>path to the stylelint configuration file</p></td>
</tr>


Expand Down Expand Up @@ -316,8 +316,8 @@ <h5>Parameters:</h5>
</td>


<td class="description last"><p>an object that lets you override default importOnce resolver
configuration</p></td>
<td class="description last"><p>an object that lets you override default
importOnce resolver configuration</p></td>
</tr>


Expand Down Expand Up @@ -368,7 +368,7 @@ <h4 class="name" id="compiler"><span class="type-signature"></span>compiler<span

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="SASS.js.html">SASS.js</a>, <a href="SASS.js.html#line38">line 38</a>
<a href="SASS.js.html">SASS.js</a>, <a href="SASS.js.html#line41">line 41</a>
</li></ul></dd>


Expand Down Expand Up @@ -451,7 +451,7 @@ <h4 class="name" id="fe"><span class="type-signature"></span>fe<span class="sign

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="SASS.js.html">SASS.js</a>, <a href="SASS.js.html#line89">line 89</a>
<a href="SASS.js.html">SASS.js</a>, <a href="SASS.js.html#line92">line 92</a>
</li></ul></dd>


Expand Down Expand Up @@ -740,7 +740,7 @@ <h4 class="name" id="lint"><span class="type-signature"></span>lint<span class="

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="SASS.js.html">SASS.js</a>, <a href="SASS.js.html#line65">line 65</a>
<a href="SASS.js.html">SASS.js</a>, <a href="SASS.js.html#line68">line 68</a>
</li></ul></dd>


Expand Down
19 changes: 11 additions & 8 deletions docs/SASS.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ <h1 class="page-title">SASS.js</h1>
import {SASSLint} from './SASSLint';
import noop from 'lodash/noop';
import {logLintingErrors} from './logger';
import {join} from 'path';

const defaultConfigFile = join(__dirname, '..', '.stylelintrc.yaml');

/**
* SASS compilation tools
Expand All @@ -58,12 +61,12 @@ <h1 class="page-title">SASS.js</h1>
* the module in JavaScript).
*
* @class SASS
* @param {boolean} [compress=true] - if true `Compiler#save` will gzip compress the data in production
* mode
* @param {Array&lt;string>} [includePaths=[]] - an array of additional include paths
* @param {Object} [configOverrides={}] - an object that lets you override the default linting configuration
* @param {Object} [importOnceOptions={}] - an object that lets you override default importOnce resolver
* configuration
* @param {boolean} [compress=true] - if true `Compiler#save` will gzip compress the
* data in production mode
* @param {Array&lt;string>} [includePaths=[]] - an array of additional include paths
* @param {string} [configFile="webcompiler/.stylelintrc.yaml"] - path to the stylelint configuration file
* @param {Object} [importOnceOptions={}] - an object that lets you override default
* importOnce resolver configuration
* @example
* import {SASS} from 'webcompiler';
* // or - import {SASS} from 'webcompiler/lib/SASS';
Expand Down Expand Up @@ -94,11 +97,11 @@ <h1 class="page-title">SASS.js</h1>
linter: SASSLint;

/* eslint-disable require-jsdoc */
constructor(compress: boolean = true, includePaths: Array&lt;string> = [], configOverrides: Object = {},
constructor(compress: boolean = true, includePaths: Array&lt;string> = [], configFile: string = defaultConfigFile,
importOnceOptions: Object = {}) {
/* eslint-enable require-jsdoc */
this.compiler = new SASSCompiler(compress, includePaths, importOnceOptions);
this.linter = new SASSLint(configOverrides);
this.linter = new SASSLint(configFile);
}

/**
Expand Down
10 changes: 5 additions & 5 deletions docs/SASSLint.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h2>



<h4 class="name" id="SASSLint"><span class="type-signature"></span>new SASSLint<span class="signature">(configOverrides<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<h4 class="name" id="SASSLint"><span class="type-signature"></span>new SASSLint<span class="signature">(configFile<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>



Expand Down Expand Up @@ -165,13 +165,13 @@ <h5>Parameters:</h5>

<tr>

<td class="name"><code>configOverrides</code></td>
<td class="name"><code>configFile</code></td>


<td class="type">


<span class="param-type">Object</span>
<span class="param-type">string</span>



Expand All @@ -192,12 +192,12 @@ <h5>Parameters:</h5>

<td class="default">

<code>{}</code>
<code>"webcompiler/.stylelintrc.yaml"</code>

</td>


<td class="description last"><p>an object that lets you override the default linting configuration</p></td>
<td class="description last"><p>path to the stylelint configuration file</p></td>
</tr>


Expand Down
Loading

0 comments on commit 053de5d

Please sign in to comment.