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.
- Loading branch information
1 parent
886b96d
commit 03cffc8
Showing
8 changed files
with
3,887 additions
and
1 deletion.
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
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,12 @@ | ||
# inv-lint | ||
|
||
# Setup | ||
|
||
1. Add `WEBHOOK_PATH` environmental variable to your project on circleCI. | ||
|
||
To do this you will have to: | ||
|
||
- Go to `https://circleci.com/gh/invisible-tech/<your-project-name>/edit#env-vars` (replace \<your-project-name\>, e.g. gear) | ||
- Click on `Import Variable(s)`. | ||
- Select `WEBHOOK_PATH`. | ||
- If you don't have permission to do that, ask your superior to do it! |
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,62 @@ | ||
{ | ||
"name": "inv-lint", | ||
"license": "UNLICENSED", | ||
"version": "0.0.1", | ||
"description": "", | ||
"engines": { | ||
"node": "^8.4.0" | ||
}, | ||
"homepage": "", | ||
"author": { | ||
"email": "[email protected]", | ||
"name": "Invisible Technologies", | ||
"url": "https://github.com/invisible-tech" | ||
}, | ||
"files": [ | ||
"src" | ||
], | ||
"main": "src/index.js", | ||
"bin": { | ||
"inv-lint": "src/index.js" | ||
}, | ||
"keywords": [], | ||
"devDependencies": { | ||
"avow": "^4.0.3", | ||
"docdash": "^0.4.0", | ||
"dotenv": "^4.0.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')" | ||
}, | ||
"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" | ||
} | ||
} |
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,17 @@ | ||
#!/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] | ||
|
||
spawn.sync('eslint', eslintCommand, { stdio: 'inherit' }) | ||
spawn.sync('eslint', fixCommand, { stdio: 'inherit' }) |
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,4 @@ | ||
'use strict' | ||
|
||
process.env.NODE_ENV = 'test' | ||
require('dotenv').config({ path: `${__dirname}/../../.env` }) |
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,17 @@ | ||
'use strict' | ||
|
||
const avow = require('avow') | ||
const { forEach } = require('lodash/fp') | ||
|
||
const envVars = [ | ||
'LOGGER_LEVEL', | ||
'NODE_ENV', | ||
] | ||
|
||
describe('envVars', () => { | ||
forEach(name => { | ||
it(name, () => { | ||
avow.notEqual(process.env[name], null, `${name} is not set`) | ||
}) | ||
})(envVars) | ||
}) |
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,8 @@ | ||
'use strict' | ||
|
||
/** | ||
* This file exists to make requires easier for all our test files. | ||
* We might need to move around dependent modules, and this allows us to make | ||
* the change in one place. | ||
*/ | ||
require('~/test/helpers/loadEnv') |
Oops, something went wrong.