Skip to content

Commit

Permalink
Move "@typescript-eslint/naming-convention" back to app
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Jan 15, 2022
1 parent 6a81fc8 commit b12ef09
Showing 1 changed file with 0 additions and 67 deletions.
67 changes: 0 additions & 67 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,73 +52,6 @@ const config = {
// Enable extra rules
"filenames/match-exported": "error",

// Adapted from https://github.com/xojs/eslint-config-xo-typescript/blob/9ce1d346e743c1fc3bb4b1892f508824fa1557ed/index.js#L277
"@typescript-eslint/naming-convention": [
"error",
{
// Note: Leaving out `parameter` and `typeProperty` because of the mentioned known issues.
// Note: We are intentionally leaving out `enumMember` as it's usually pascal-case or upper-snake-case.
selector: [
"classProperty",
"parameterProperty",
"classMethod",
"typeMethod",
"accessor",
],
format: ["strictCamelCase"],
// We allow double underscope because of GraphQL type names and some React names.
leadingUnderscore: "allowSingleOrDouble",
trailingUnderscore: "allow",
// Ignore `{'Retry-After': retryAfter}` type properties.
filter: {
regex: "[- ]",
match: false,
},
},
{
selector: "typeLike",
format: ["StrictPascalCase"],
},
{
selector: "variable",
types: ["boolean"],
format: ["StrictPascalCase"],
prefix: ["is", "has", "can", "should", "will", "did"],
},
{
// Interface name should not be prefixed with `I`.
selector: "interface",
filter: /^(?!I)[A-Z]/.source,
format: ["StrictPascalCase"],
},
{
// Type parameter name should either be `T` or a descriptive name.
selector: "typeParameter",
filter: /^T$|^[A-Z][A-Za-z]+$/.source,
format: ["StrictPascalCase"],
},
// Allow these in non-camel-case when quoted.
{
selector: ["classProperty", "objectLiteralProperty"],
format: null,
modifiers: ["requiresQuotes"],
},

{
selector: "variable",
types: ["boolean", "string", "number"],
format: ["camelCase", "UPPER_CASE"],
},
{
selector: ["function"],
format: ["camelCase", "PascalCase"],
},
{
selector: ["objectLiteralProperty", "objectLiteralMethod"],
format: ["camelCase", "PascalCase", "snake_case"],
},
],

"import/dynamic-import-chunkname": [
"error",
{
Expand Down

0 comments on commit b12ef09

Please sign in to comment.