Skip to content

Commit

Permalink
Merge pull request #3 from ponbike/feature/first-draft
Browse files Browse the repository at this point in the history
Feature/first draft
  • Loading branch information
pieter-pon authored Oct 27, 2021
2 parents d753217 + 1a6acd8 commit c3614a7
Show file tree
Hide file tree
Showing 6 changed files with 174 additions and 55 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

JavaScript Standard Style with custom PON tweaks

The default standardjs lint rules: https://github.com/standard/eslint-config-standard/blob/master/.eslintrc.json

## Install

```
Expand Down
10 changes: 5 additions & 5 deletions bin/cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ var major = parseInt(match[1], 10)
var minor = parseInt(match[2], 10)

if (major >= 14 || (major === 14 && minor >= 14)) {
eval('import("standard-engine")').then(function (standardEngine) {
eval('import("../options.js")').then(function (options) {
standardEngine.cli(options.default)
})
eval('import("standard-engine")').then((standardEngine) => {
eval('import("../options.js")').then((options) => {
standardEngine.cli(options.default)
})
})
} else {
console.error('ponstandard: Node 14.14.0 or greater is required. `pomstandard` did not run.')
console.error('ponstandard: Node 14.14.0 or greater is required. `pomstandard` did not run.')
}
186 changes: 151 additions & 35 deletions eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
{
"extends": "standard",
"rules": {
"indent": [
"block-scoped-var": "error",
"complexity": [
"error",
4,
{
"ignoredNodes": [
"TemplateLiteral"
]
"max": 20
}
],
"camelcase": [
"consistent-return": "error",
"max-classes-per-file": [
"error",
{
"properties": "never"
}
1
],
"max-params": [
"warn",
Expand All @@ -33,59 +30,66 @@
"unix"
],
"class-methods-use-this": "off",
"comma-style": [
"warn",
"last"
],
"no-mixed-spaces-and-tabs": [
"warn"
],
"no-prototype-builtins": "off",
"no-return-assign": [
"no-alert": "error",
"no-caller": "error",
"no-extra-label": "error",
"no-labels": [
"error",
"except-parens"
{
"allowLoop": false,
"allowSwitch": false
}
],
"no-loop-func": "error",
"no-prototype-builtins": "off",
"no-restricted-syntax": [
"error",
"ForInStatement",
"LabeledStatement",
"WithStatement"
],
"no-unused-vars": [
"no-return-await": "error",
"no-else-return": [
"error",
{
"ignoreRestSiblings": true,
"argsIgnorePattern": "res|next|^err"
"allowElseIf": false
}
],
"prefer-const": [
"error",
{
"destructuring": "all"
}
"no-multi-assign": [
"error"
],
"arrow-body-style": [
"error",
"as-needed"
],
"no-unused-expressions": [
"error",
{
"allowTaggedTemplates": true
}
],
"no-console": "warn",
"no-param-reassign": [
"error",
{
"props": false
"props": true,
"ignorePropertyModificationsFor": [
"acc",
"accumulator",
"e",
"req",
"request",
"res",
"response"
]
}
],
"no-useless-concat": "error",
"no-nested-ternary": "error",
"max-len": [
"error",
{
"code": 120,
"comments": 80,
"tabWidth": 4
"tabWidth": 4,
"ignoreUrls": true,
"ignoreRegExpLiterals": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true
}
],
"no-shadow": [
Expand All @@ -102,6 +106,16 @@
]
}
],
"no-spaced-func": "error",
"no-underscore-dangle": [
"error",
{
"allow": [],
"allowAfterThis": false,
"allowAfterSuper": false,
"enforceInMethodNames": true
}
],
"quotes": [
"error",
"single",
Expand All @@ -110,8 +124,110 @@
"allowTemplateLiterals": true
}
],
"radix": "error",
"import/prefer-default-export": "off",
"import/no-unresolved": [
"error",
{
"caseSensitive": true
}
],
"import/named": "error",
"import/no-named-as-default": "error",
"import/no-named-as-default-member": "error",
"import/no-mutable-exports": "error",
"import/order": [
"error",
{
"groups": [
[
"builtin",
"external",
"internal"
]
]
}
],
"import/newline-after-import": "error",
"import/no-self-import": "error",
"import/no-cycle": [
"error",
{
"maxDepth": ""
}
],
"import/no-useless-path-segments": [
"error",
{
"commonjs": true
}
],
"vars-on-top": "error",
"for-direction": "error",
"getter-return": [
"error",
{
"allowImplicit": true
}
],
"no-await-in-loop": "error",
"no-inner-declarations": "error",
"no-var": "error",
"no-lonely-if": "error",
"prefer-arrow-callback": [
"error",
{
"allowNamedFunctions": false,
"allowUnboundThis": true
}
],
"prefer-destructuring": [
"error",
{
"VariableDeclarator": {
"array": false,
"object": true
},
"AssignmentExpression": {
"array": true,
"object": false
}
},
{
"enforceForRenamedProperties": false
}
],
"prefer-rest-params": "error",
"prefer-spread": "error",
"prefer-template": "error",
"require-yield": "error",
"function-paren-newline": [
"error",
"consistent"
],
"implicit-arrow-linebreak": [
"error",
"beside"
],
"newline-per-chained-call": [
"error",
{
"ignoreChainWithDepth": 4
}
],
"nonblock-statement-body-position": [
"error",
"beside",
{
"overrides": {}
}
],
"operator-assignment": [
"error",
"always"
],
"prefer-object-spread": "error",
"no-delete-var": "error",
"valid-jsdoc": [
"error",
{
Expand Down
25 changes: 13 additions & 12 deletions options.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@ const pkg = JSON.parse(readFileSync(pkgUrl, 'utf-8'))
const configFile = fileURLToPath(new URL('eslintrc.json', import.meta.url))
const baseConfig = JSON.parse(readFileSync(stdOpts.eslintConfig.configFile, 'utf-8'))

export default Object.assign({}, stdOpts, {
bugs: pkg.bugs.url,
cmd: 'ponstandard',
eslint,
eslintConfig: {
baseConfig,
configFile,
useEslintrc: true
},
homepage: pkg.homepage,
tagline: 'Use JavaScript Standard Style (tweaked by PON)',
version: `${pkg.version} (standard ${stdVersion})`
export default ({
...stdOpts,
bugs: pkg.bugs.url,
cmd: 'ponstandard',
eslint,
eslintConfig: {
baseConfig,
configFile,
useEslintrc: true
},
homepage: pkg.homepage,
tagline: 'Use JavaScript Standard Style (tweaked by PON)',
version: `${pkg.version} (standard ${stdVersion})`
})
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ponbike/ponstandard",
"description": "JavaScript Standard Style with custom PON tweaks",
"version": "0.1.0",
"version": "0.2.0",
"author": {
"name": "Pieter Wigboldus",
"email": "[email protected]",
Expand Down

0 comments on commit c3614a7

Please sign in to comment.