Skip to content

Commit

Permalink
chore: fresh
Browse files Browse the repository at this point in the history
Signed-off-by: Charlike Mike Reagent <[email protected]>
  • Loading branch information
tunnckoCore committed Jan 31, 2020
1 parent 3a291ce commit 975ab31
Show file tree
Hide file tree
Showing 85 changed files with 8,636 additions and 0 deletions.
184 changes: 184 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
{
"projectName": "node-formidable",
"projectOwner": "node-formidable",
"repoType": "github",
"repoHost": "https://github.com",
"imageSize": 100,
"contributorsPerLine": 6,
"commitConvention": "angular",
"commit": true,
"skipCi": true,
"files": [
"README.md"
],
"contributors": [
{
"login": "felixge",
"name": "Felix Geisendörfer",
"avatar_url": "https://avatars3.githubusercontent.com/u/15000?s=460&v=4",
"profile": "https://twitter.com/felixge",
"contributions": [
"code",
"design",
"ideas",
"doc"
]
},
{
"login": "tunnckoCore",
"name": "Charlike Mike Reagent",
"avatar_url": "https://avatars3.githubusercontent.com/u/5038030?v=4",
"profile": "https://tunnckoCore.com",
"contributions": [
"bug",
"infra",
"design",
"code",
"doc",
"example",
"ideas",
"maintenance",
"test"
]
},
{
"login": "kedarv",
"name": "Kedar",
"avatar_url": "https://avatars1.githubusercontent.com/u/1365665?v=4",
"profile": "https://github.com/kedarv",
"contributions": [
"code",
"test",
"question",
"bug"
]
},
{
"login": "GrosSacASac",
"name": "Walle Cyril",
"avatar_url": "https://avatars0.githubusercontent.com/u/5721194?v=4",
"profile": "https://github.com/GrosSacASac",
"contributions": [
"question",
"bug",
"code",
"financial",
"ideas",
"maintenance"
]
},
{
"login": "xarguments",
"name": "Xargs",
"avatar_url": "https://avatars2.githubusercontent.com/u/40522463?v=4",
"profile": "https://github.com/xarguments",
"contributions": [
"question",
"bug",
"code",
"maintenance"
]
},
{
"login": "Amit-A",
"name": "Amit-A",
"avatar_url": "https://avatars1.githubusercontent.com/u/7987238?v=4",
"profile": "https://github.com/Amit-A",
"contributions": [
"question",
"bug",
"code"
]
},
{
"login": "charmander",
"name": "Charmander",
"avatar_url": "https://avatars1.githubusercontent.com/u/1889843?v=4",
"profile": "https://charmander.me/",
"contributions": [
"question",
"bug",
"code",
"ideas",
"maintenance"
]
},
{
"login": "DylanPiercey",
"name": "Dylan Piercey",
"avatar_url": "https://avatars2.githubusercontent.com/u/4985201?v=4",
"profile": "https://twitter.com/dylan_piercey",
"contributions": [
"ideas"
]
},
{
"login": "ad-m",
"name": "Adam Dobrawy",
"avatar_url": "https://avatars1.githubusercontent.com/u/3618479?v=4",
"profile": "http://ochrona.jawne.info.pl",
"contributions": [
"bug",
"doc"
]
},
{
"login": "amitrohatgi",
"name": "amitrohatgi",
"avatar_url": "https://avatars3.githubusercontent.com/u/12177021?v=4",
"profile": "https://github.com/amitrohatgi",
"contributions": [
"ideas"
]
},
{
"login": "fengxinming",
"name": "Jesse Feng",
"avatar_url": "https://avatars2.githubusercontent.com/u/6262382?v=4",
"profile": "https://github.com/fengxinming",
"contributions": [
"bug"
]
},
{
"login": "quantumsheep",
"name": "Nathanael Demacon",
"avatar_url": "https://avatars1.githubusercontent.com/u/7271496?v=4",
"profile": "https://qtmsheep.com",
"contributions": [
"question",
"code",
"review"
]
},
{
"login": "MunMunMiao",
"name": "MunMunMiao",
"avatar_url": "https://avatars1.githubusercontent.com/u/18216142?v=4",
"profile": "https://github.com/MunMunMiao",
"contributions": [
"bug"
]
},
{
"login": "gabipetrovay",
"name": "Gabriel Petrovay",
"avatar_url": "https://avatars0.githubusercontent.com/u/1170398?v=4",
"profile": "https://github.com/gabipetrovay",
"contributions": [
"bug",
"code"
]
},
{
"login": "Elzair",
"name": "Philip Woods",
"avatar_url": "https://avatars0.githubusercontent.com/u/2352818?v=4",
"profile": "https://github.com/Elzair",
"contributions": [
"code",
"ideas"
]
}
]
}
27 changes: 27 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Ignore everything!
*

# de-ignores: add here what you want to be committed
!*.mjs
!*.cjs
!*.js*
!*.ts*
!*.md*

!**/src
!**/src/**

!**/test
!**/test/**

!**/*tests*
!**/*tests*/**

!**/benchmark*
!**/benchmark*/**

!**/example*
!**/example*/**

# re-ignores: add here what you want to be ignored again
test/tmp
176 changes: 176 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
'use strict';

const airbnbBase = require('eslint-config-airbnb-base');

// eslint-disable-next-line import/no-dynamic-require
const bestPractices = require(airbnbBase.extends[0]);

const ignoredProps = bestPractices.rules[
'no-param-reassign'
][1].ignorePropertyModificationsFor.concat(
'err',
'x',
'_',
'opts',
'options',
'settings',
'config',
'cfg',
);

// Additional rules that are specific and overiding previous
const additionalChanges = {
strict: 'off',

// Enforce using named functions when regular function is used,
// otherwise use arrow functions
'func-names': ['error', 'always'],
// Always use parens (for consistency).
// https://eslint.org/docs/rules/arrow-parens
'arrow-parens': ['error', 'always', { requireForBlockBody: true }],
'prefer-arrow-callback': [
'error',
{ allowNamedFunctions: true, allowUnboundThis: true },
],
// http://eslint.org/docs/rules/max-params
'max-params': ['error', { max: 3 }],
// http://eslint.org/docs/rules/max-statements
'max-statements': ['error', { max: 20 }],
// http://eslint.org/docs/rules/max-statements-per-line
'max-statements-per-line': ['error', { max: 1 }],
// http://eslint.org/docs/rules/max-nested-callbacks
'max-nested-callbacks': ['error', { max: 4 }],
// http://eslint.org/docs/rules/max-depth
'max-depth': ['error', { max: 4 }],
// enforces no braces where they can be omitted
// https://eslint.org/docs/rules/arrow-body-style
// Never enable for object literal.
'arrow-body-style': [
'error',
'as-needed',
{ requireReturnForObjectLiteral: false },
],
// Allow functions to be use before define because:
// 1) they are hoisted,
// 2) because ensure read flow is from top to bottom
// 3) logically order of the code.
// 4) the only addition is 'typedefs' option, see overrides for TS files
'no-use-before-define': [
'error',
{
functions: false,
classes: true,
variables: true,
},
],
// Same as AirBnB, but adds `opts`, `options`, `x` and `err` to exclusions!
// disallow reassignment of function parameters
// disallow parameter object manipulation except for specific exclusions
// rule: https://eslint.org/docs/rules/no-param-reassign.html
'no-param-reassign': [
'error',
{
props: true,
ignorePropertyModificationsFor: ignoredProps,
},
],

// disallow declaration of variables that are not used in the code
'no-unused-vars': [
'error',
{
ignoreRestSiblings: true, // airbnb's default
vars: 'all', // airbnb's default
varsIgnorePattern: '^(?:$$|xx|_|__|[iI]gnor(?:e|ing|ed))',
args: 'after-used', // airbnb's default
argsIgnorePattern: '^(?:$$|xx|_|__|[iI]gnor(?:e|ing|ed))',

// catch blocks are handled by Unicorns
caughtErrors: 'none',
// caughtErrorsIgnorePattern: '^(?:$$|xx|_|__|[iI]gnor(?:e|ing|ed))',
},
],
};

const importRules = {
'import/namespace': ['error', { allowComputed: true }],
'import/no-absolute-path': 'error',
'import/no-webpack-loader-syntax': 'error',
'import/no-self-import': 'error',

// Enable this sometime in the future when Node.js has ES2015 module support
// 'import/no-cycle': 'error',

// Disabled as it doesn't work with TypeScript
// 'import/newline-after-import': 'error',

'import/no-amd': 'error',
'import/no-duplicates': 'error',

// Enable this sometime in the future when Node.js has ES2015 module support
// 'import/unambiguous': 'error',

// Enable this sometime in the future when Node.js has ES2015 module support
// 'import/no-commonjs': 'error',

// Looks useful, but too unstable at the moment
// 'import/no-deprecated': 'error',

'import/no-extraneous-dependencies': 'off',
'import/no-mutable-exports': 'error',
'import/no-named-as-default-member': 'error',
'import/no-named-as-default': 'error',

// Disabled because it's buggy and it also doesn't work with TypeScript
// 'import/no-unresolved': [
// 'error',
// {
// commonjs: true
// }
// ],

'import/order': 'error',
'import/no-unassigned-import': [
'error',
{ allow: ['@babel/polyfill', '@babel/register'] },
],

'import/prefer-default-export': 'off',

// Ensure more web-compat
// ! note that it doesn't work in CommonJS
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/extensions.md
'import/extensions': 'off',

// ? Always use named exports. Enable?
// 'import/no-default-export': 'error',

// ? enable?
'import/exports-last': 'off',

// todo: Enable in future.
// Ensures everything is tested (all exports should be used).
// For cases when you don't want or can't test, add eslint-ignore comment!
// see: https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unused-modules.md
'import/no-unused-modules': 'off',

'import/no-useless-path-segments': ['error', { noUselessIndex: false }],
};

module.exports = {
env: {
es6: true,
es2020: true,
jest: true,
node: true,
commonjs: true,
},
extends: ['eslint:recommended', 'airbnb-base', 'plugin:prettier/recommended'],
plugins: ['prettier'],
rules: {
'prettier/prettier': 'error',

...additionalChanges,
...importRules,
},
};
Loading

0 comments on commit 975ab31

Please sign in to comment.