Skip to content

Commit

Permalink
Merge pull request #14 from paritytech/yuri/line-width-120
Browse files Browse the repository at this point in the history
Using 120 chars line width
  • Loading branch information
mutantcornholio authored Aug 30, 2022
2 parents 55ce9a8 + 34f3093 commit 39e6e0e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 38 deletions.
45 changes: 8 additions & 37 deletions src/eslint/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ const baseRules = {
"unused-imports/no-unused-imports-ts": "error",
"unused-imports/no-unused-vars-ts": [
"error",
{
vars: "all",
varsIgnorePattern: "^_",
args: "after-used",
argsIgnorePattern: "^_",
},
{ vars: "all", varsIgnorePattern: "^_", args: "after-used", argsIgnorePattern: "^_" },
],

// related to import sorting and ordering
Expand All @@ -27,13 +22,7 @@ const baseRules = {
"no-multiple-empty-lines": ["error", { max: 1, maxEOF: 1 }],
"simple-import-sort/imports": [
"error",
{
groups: [
["^([^s.]|s($|[^r])|s($|[^r]$|r[^c])|sr($|c[^/]))"],
["^src"],
["."],
],
},
{ groups: [["^([^s.]|s($|[^r])|s($|[^r]$|r[^c])|sr($|c[^/]))"], ["^src"], ["."]] },
],
"import/first": "error",
"import/newline-after-import": "error",
Expand Down Expand Up @@ -74,13 +63,11 @@ const baseRules = {
message: "setTimeout must always be invoked with two arguments.",
},
{
selector:
"CallExpression[callee.name='setInterval'][arguments.length!=2]",
selector: "CallExpression[callee.name='setInterval'][arguments.length!=2]",
message: "setInterval must always be invoked with two arguments.",
},
{
selector:
"CallExpression[arguments.length=1] > MemberExpression.callee > Identifier.property[name='reduce']",
selector: "CallExpression[arguments.length=1] > MemberExpression.callee > Identifier.property[name='reduce']",
message: "Provide initialValue to .reduce().",
},
],
Expand All @@ -91,11 +78,7 @@ const baseRules = {
"dot-notation": "error",
"no-redeclare": "error",
"arrow-parens": "error",
"arrow-body-style": [
"error",
"as-needed",
{ requireReturnForObjectLiteral: true },
],
"arrow-body-style": ["error", "as-needed", { requireReturnForObjectLiteral: true }],
}

const typescriptRules = {
Expand All @@ -110,10 +93,7 @@ const typescriptRules = {
allowNullableString: true,
},
],
"@typescript-eslint/explicit-module-boundary-types": [
"error",
{ allowHigherOrderFunctions: true },
],
"@typescript-eslint/explicit-module-boundary-types": ["error", { allowHigherOrderFunctions: true }],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/interface-name-prefix": "off",
Expand Down Expand Up @@ -158,13 +138,7 @@ const typescriptRules = {

const baseExtends = ["eslint:recommended", "plugin:prettier/recommended"]

const basePlugins = [
"sonarjs",
"unused-imports",
"simple-import-sort",
"import",
"prettier",
]
const basePlugins = ["sonarjs", "unused-imports", "simple-import-sort", "import", "prettier"]

const getTypescriptOverride = ({ rootDir }) => {
return {
Expand All @@ -184,10 +158,7 @@ const getJestTypescriptOverride = () => {
return {
files: "{*,**,**/*}.spec.ts",
plugins: ["jest"],
rules: {
"@typescript-eslint/unbound-method": "off",
"jest/unbound-method": "error",
},
rules: { "@typescript-eslint/unbound-method": "off", "jest/unbound-method": "error" },
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/prettier/configuration.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = { semi: false, trailingComma: "all", arrowParens: "always" }
module.exports = { semi: false, trailingComma: "all", arrowParens: "always", printWidth: 120 }

0 comments on commit 39e6e0e

Please sign in to comment.