This repository has been archived by the owner on Sep 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from invisible-tech/rgo/bootstrap
feat: bootstrap @invisible eslint plugin
- Loading branch information
Showing
13 changed files
with
337 additions
and
1,923 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,3 @@ | ||
{ | ||
"extends": [ | ||
"plugin:lodash-fp/recommended", | ||
"airbnb/base" | ||
], | ||
"env": { | ||
"node": true, | ||
"mocha": true, | ||
"es6": true | ||
}, | ||
"plugins": [ | ||
"lodash-fp", | ||
"promise" | ||
], | ||
"parserOptions": { | ||
"sourceType": "script", | ||
"ecmaVersion": 8 | ||
}, | ||
"rules": { | ||
"array-bracket-spacing": "off", | ||
"arrow-parens": ["error", "as-needed", { "requireForBlockBody": false }], | ||
"brace-style": ["error", "1tbs", { "allowSingleLine": true }], | ||
"consistent-return": "off", | ||
"comma-dangle": ["error", { | ||
"arrays": "always-multiline", | ||
"objects": "always-multiline", | ||
"imports": "always-multiline", | ||
"exports": "always-multiline", | ||
"functions": "ignore" | ||
}], | ||
"func-names": "off", | ||
"generator-star-spacing": ["error", "after"], | ||
"global-require": "off", | ||
"guard-for-in": "off", | ||
"import/no-dynamic-require": "off", | ||
"import/no-extraneous-dependencies": "off", | ||
"indent": ["error", 2, { "CallExpression": { "arguments": "first" }, "SwitchCase": 1 }], | ||
"max-len": "off", | ||
"newline-per-chained-call": "off", | ||
"no-continue": "off", | ||
"no-multiple-empty-lines": "off", | ||
"no-param-reassign": ["error", {"props": false}], | ||
"no-plusplus": ["error", { "allowForLoopAfterthoughts": true }], | ||
"no-restricted-syntax": ["error", "ClassDeclaration"], | ||
"no-underscore-dangle": "off", | ||
"no-unused-vars": ["error", { "vars": "all", "args": "after-used" }], | ||
"no-use-before-define": "off", | ||
"one-var": ["error", { "uninitialized": "always", "initialized": "never" }], | ||
"one-var-declaration-per-line": ["error", "initializations"], | ||
"prefer-rest-params": "off", | ||
"promise/always-return": "error", | ||
"promise/catch-or-return": "error", | ||
"promise/no-native": "off", | ||
"promise/param-names": "error", | ||
"require-yield": "off", | ||
"semi": ["error", "never"], | ||
"space-before-function-paren": ["error", { | ||
"anonymous": "never", | ||
"named": "never", | ||
"asyncArrow": "always" | ||
}], | ||
"space-in-parens": "off", | ||
"space-unary-ops": ["error", { | ||
"words": true, | ||
"nonwords": false, | ||
"overrides": { | ||
"!": true | ||
} | ||
}], | ||
"strict": ["error", "global"], | ||
"valid-jsdoc": "error" | ||
}, | ||
"settings": { | ||
"lodash": { | ||
"pragma": "fp" | ||
} | ||
} | ||
"extends": "./src/index.js" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
8.1.4 | ||
8.5.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2017 Invisible Technologies | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is furnished | ||
to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
# inv-lint | ||
> Invisible Technologies Eslint Package | ||
# @invisible/eslint-config | ||
> Invisible Technologies Eslint Config | ||
# Install | ||
|
||
``` | ||
yarn add -D invisible-tech/inv-lint | ||
yarn add -D @invisible/eslint-config | ||
# or | ||
npm install -D invisible-tech/inv-lint | ||
npm install -D @invisible/eslint-config | ||
``` | ||
|
||
# Usage | ||
|
||
1. Add `inv-lint` to your lint script on `package.json` | ||
```json | ||
1. Add `"@invisible"` to `extends` on your `.eslintrc.json` file: | ||
```json | ||
// It should look something like: | ||
"lint": "inv-lint", | ||
"pretest": "yarn run lint", | ||
``` | ||
{ | ||
"extends": "@invisible" | ||
} | ||
``` | ||
|
||
2. Add eslint as a devDependency: | ||
``` | ||
yarn add -D eslint | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{ | ||
"name": "inv-lint", | ||
"license": "UNLICENSED", | ||
"version": "0.0.1", | ||
"description": "", | ||
"name": "@invisible/eslint-config", | ||
"license": "MIT", | ||
"version": "1.0.0", | ||
"description": "Invisible Rules", | ||
"engines": { | ||
"node": "^8.4.0" | ||
"node": "^8.5.0" | ||
}, | ||
"homepage": "", | ||
"author": { | ||
|
@@ -16,47 +16,41 @@ | |
"src" | ||
], | ||
"main": "src/index.js", | ||
"bin": { | ||
"inv-lint": "src/index.js" | ||
}, | ||
"keywords": [], | ||
"keywords": [ | ||
"eslint", | ||
"eslintplugin" | ||
], | ||
"devDependencies": { | ||
"avow": "^4.0.3", | ||
"docdash": "^0.4.0", | ||
"dotenv": "^4.0.0", | ||
"eslint": "^4.7.1", | ||
"eslint-config-airbnb": "^15.1.0", | ||
"eslint-formatter-pretty": "^1.3.0", | ||
"eslint-plugin-import": "^2.7.0", | ||
"eslint-plugin-jsx-a11y": "^6.0.2", | ||
"eslint-plugin-lodash-fp": "^2.1.3", | ||
"eslint-plugin-promise": "^3.5.0", | ||
"eslint-plugin-react": "^7.3.0", | ||
"jsdoc": "^3.5.4", | ||
"lodash": "^4.17.4", | ||
"mocha": "^3.5.3", | ||
"mock-require": "^2.0.2", | ||
"nsp": "^2.8.0", | ||
"nyc": "^11.2.1", | ||
"recursive-readdir": "^2.2.1", | ||
"sinon": "^3.2.1", | ||
"sinon-express-mock": "^1.3.1", | ||
"yarn": "^0.27.5" | ||
}, | ||
"repository": "[email protected]:invisible-tech/inv-lint.git", | ||
"scripts": { | ||
"builddoc": "./node_modules/.bin/jsdoc -c ./.jsdoc.json", | ||
"coverage": "nyc report --reporter=lcov --reporter=html --reporter=text-summary --reporter=text", | ||
"fix": "eslint --cache --fix scripts src test", | ||
"lint": "eslint --cache -f node_modules/eslint-formatter-pretty scripts src test", | ||
"postinstall": "scripts/postinstall.sh", | ||
"prepublish": "nsp check", | ||
"pretest": "yarn run lint", | ||
"test": "yarn run test-only", | ||
"test-only": "NODE_ENV=test nyc mocha $(find test -name '*.spec.js')" | ||
"lint": "eslint --cache -f node_modules/eslint-formatter-pretty --ignore-path .gitignore .", | ||
"test": "npm run lint", | ||
"prepublish": "nsp check" | ||
}, | ||
"dependencies": { | ||
"cross-spawn": "^5.1.0", | ||
"eslint": "^4.6.1", | ||
"eslint-config-airbnb": "^15.1.0", | ||
"eslint-formatter-list": "^1.0.0", | ||
"eslint-formatter-pretty": "^1.3.0", | ||
"eslint-plugin-import": "^2.7.0", | ||
"eslint-plugin-jsx-a11y": "^6.0.2", | ||
"eslint-plugin-lodash-fp": "^2.1.3", | ||
"eslint-plugin-promise": "^3.5.0", | ||
"eslint-plugin-react": "^7.3.0" | ||
}, | ||
"peerDependencies": { | ||
"eslint": ">=4.7.1" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,82 @@ | ||
#!/usr/bin/env node | ||
|
||
'use strict' | ||
|
||
const spawn = require('cross-spawn') | ||
|
||
const cwd = process.cwd() | ||
|
||
const configFilePath = `${cwd}/node_modules/inv-lint/.eslintrc.json` | ||
const outputFormatPath = `${cwd}/node_modules/eslint-formatter-pretty` | ||
const filesPath = [`${cwd}/scripts`, `${cwd}/src`, `${cwd}/test`, '--ignore-path', `${cwd}/.gitignore`] | ||
|
||
const eslintCommand = ['-c', configFilePath, '--cache', '-f', outputFormatPath, ...filesPath] | ||
const fixCommand = ['-c', configFilePath, '--cache', '--fix', ...filesPath] | ||
/* eslint-disable quote-props */ | ||
|
||
spawn.sync('eslint', eslintCommand, { stdio: 'inherit' }) | ||
spawn.sync('eslint', fixCommand, { stdio: 'inherit' }) | ||
module.exports = { | ||
extends: [ | ||
'plugin:lodash-fp/recommended', | ||
'airbnb/base', | ||
], | ||
env: { | ||
node: true, | ||
mocha: true, | ||
es6: true, | ||
}, | ||
plugins: [ | ||
'lodash-fp', | ||
'promise', | ||
], | ||
parserOptions: { | ||
sourceType: 'script', | ||
ecmaVersion: 8, | ||
}, | ||
settings: { | ||
lodash: { | ||
pragma: 'fp', | ||
}, | ||
}, | ||
rules: { | ||
'array-bracket-spacing': 'off', | ||
'arrow-parens': ['error', 'as-needed', { requireForBlockBody: false }], | ||
'brace-style': ['error', '1tbs', { allowSingleLine: true }], | ||
'consistent-return': 'off', | ||
'comma-dangle': ['error', { | ||
arrays: 'always-multiline', | ||
objects: 'always-multiline', | ||
imports: 'always-multiline', | ||
exports: 'always-multiline', | ||
functions: 'ignore', | ||
}], | ||
'func-names': 'off', | ||
'generator-star-spacing': ['error', 'after'], | ||
'global-require': 'off', | ||
'guard-for-in': 'off', | ||
'import/no-dynamic-require': 'off', | ||
'import/no-extraneous-dependencies': 'off', | ||
'indent': ['error', 2, { CallExpression: { arguments: 'first' }, SwitchCase: 1 }], | ||
'max-len': 'off', | ||
'newline-per-chained-call': 'off', | ||
'no-continue': 'off', | ||
'no-multiple-empty-lines': 'off', | ||
'no-param-reassign': ['error', { props: false }], | ||
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }], | ||
'no-restricted-syntax': ['error', 'ClassDeclaration'], | ||
'no-underscore-dangle': 'off', | ||
'no-unused-vars': ['error', { vars: 'all', args: 'after-used' }], | ||
'no-use-before-define': 'off', | ||
'one-var': ['error', { uninitialized: 'always', initialized: 'never' }], | ||
'one-var-declaration-per-line': ['error', 'initializations'], | ||
'prefer-rest-params': 'off', | ||
'promise/always-return': 'error', | ||
'promise/catch-or-return': 'error', | ||
'promise/no-native': 'off', | ||
'promise/param-names': 'error', | ||
'require-yield': 'off', | ||
'semi': ['error', 'never'], | ||
'space-before-function-paren': ['error', { | ||
anonymous: 'never', | ||
named: 'never', | ||
asyncArrow: 'always', | ||
}], | ||
'space-in-parens': 'off', | ||
'space-unary-ops': ['error', { | ||
words: true, | ||
nonwords: false, | ||
overrides: { | ||
'!': true, | ||
}, | ||
}], | ||
'strict': ['error', 'global'], | ||
'valid-jsdoc': 'error', | ||
}, | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.