Skip to content

Commit

Permalink
ui: use share config for eslint
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Login <batazor@evrone.com>
  • Loading branch information
batazor committed Jun 8, 2023
1 parent 77b9885 commit 6adc159
Show file tree
Hide file tree
Showing 28 changed files with 670 additions and 744 deletions.
896 changes: 426 additions & 470 deletions ui/nx-monorepo/package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions ui/nx-monorepo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"@nrwl/rollup": "16.4.0-beta.2",
"@rollup/plugin-replace": "5.0.2",
"@rollup/plugin-terser": "^0.4.3",
"eslint-plugin-shortlink": "*",
"eslint-config-shortlink": "*",
"@surma/rollup-plugin-off-main-thread": "2.2.3",
"@swc/cli": "0.1.62",
"@swc/core": "1.3.62",
Expand Down
8 changes: 7 additions & 1 deletion ui/nx-monorepo/packages/eslint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@

This directory contains custom rules for ESLint.

### Configuration

#### `eslint-config-shortlink`

This configuration contains the base configuration for ShortLink.

### Rules

#### `eslint-plugin-shortlink`

This plugin contains custom rules for ShortLink.
This plugin contains custom rules for ShortLink.
97 changes: 97 additions & 0 deletions ui/nx-monorepo/packages/eslint/eslint-config-shortlink/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
env:
browser: true
node: true
es2021: true
parser: '@typescript-eslint/parser'
parserOptions:
ecmaVersion: 12
sourceType: module
ecmaFeatures:
jsx: true
extends:
- eslint:recommended
- plugin:react/recommended
- airbnb
- airbnb/hooks
- plugin:import/errors
- plugin:import/warnings
- plugin:import/typescript
- plugin:@typescript-eslint/recommended
- plugin:@next/next/recommended
- prettier
plugins:
- '@typescript-eslint'
- 'react'
- 'prettier'
# - 'shortlink'
settings:
import/resolver:
babel-module:
extensions: ['.js', '.jsx', '.ts', '.tsx']
node:
extensions: ['.js', '.jsx', '.ts', '.tsx']
paths: ['server']
rules:
semi: ['error', 'never']
default-case: off
react/jsx-filename-extension: off
# react/jsx-filename-extension: [1, { extensions: ['.ts', '.tsx'] }]
react/jsx-fragments: [1, 'element']
import/extensions: off
import/default: off
no-alert: off
consistent-return: off
react-hooks/exhaustive-deps: off
spaced-comment: off
import/first: off
import/no-extraneous-dependencies: off
import/prefer-default-export: off
import/order: off
react/jsx-key: off
react/button-has-type: off
no-underscore-dangle: off
no-console: off
default-param-last: off
'@typescript-eslint/no-explicit-any': off
'@typescript-eslint/no-empty-function': off
import/no-self-import: off
jsx-a11y/click-events-have-key-events: off
jsx-a11y/no-static-element-interactions: off
no-fallthrough: off
react/no-array-index-key: off
no-new-func: off
import/export: off
react/require-default-props: off
import/no-useless-path-segments: off
import/no-named-as-default: off
import/no-named-as-default-member: off
import/no-relative-packages: off
react/destructuring-assignment: off
'@typescript-eslint/explicit-module-boundary-types': off
react/prop-types: off
react/function-component-definition: off
jsx-a11y/anchor-is-valid: off
react/jsx-props-no-spreading: off
prettier/prettier: warn
react/no-unescaped-entities: off
import/no-cycle: [0, { ignoreExternal: true }]
prefer-const: off
# needed because of https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-use-before-define.md#how-to-use & https://stackoverflow.com/questions/63818415/react-was-used-before-it-was-defined
no-use-before-define: off
import/namespace: off
import/no-unresolved: off
import/no-duplicates: off
'jsx-a11y/label-has-associated-control': off
react/display-name: off
'@typescript-eslint/no-use-before-define':
['error', { functions: false, classes: false, variables: true }]
'@typescript-eslint/ban-ts-comment': off
react/react-in-jsx-scope: off
react/no-unused-prop-types: off
'@next/next/no-img-element': off
react/jsx-no-constructed-context-values: off
'@typescript-eslint/no-unused-vars': off
shortlink/check-author: off
shortlink/check-empty-file: off
no-restricted-globals: off
no-unused-expressions: off
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "eslint-config-shortlink",
"version": "1.0.0",
"description": "Shared ESLint configuration for ShortLink",
"main": "index.yaml",
"repository": {
"type": "git",
"url": "git+https://github.com/shortlink-org/shortlink.git"
},
"keywords": [
"eslint",
"eslintconfig",
"shortlink"
],
"author": "Login Viktor @batazor <batazor111@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/shortlink-org/shortlink/issues"
},
"homepage": "https://github.com/shortlink-org/shortlink#readme",
"peerDependencies": {
"eslint": "^8.0.0"
}
}
4 changes: 4 additions & 0 deletions ui/nx-monorepo/packages/landing/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.*
node_modules
out
public
96 changes: 1 addition & 95 deletions ui/nx-monorepo/packages/landing/.eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -1,96 +1,2 @@
env:
browser: true
node: true
es2021: true
parser: '@typescript-eslint/parser'
parserOptions:
ecmaVersion: 12
sourceType: module
ecmaFeatures:
jsx: true
plugins:
- '@typescript-eslint'
- 'react'
- 'prettier'
# - 'shortlink'
extends:
- eslint:recommended
- plugin:react/recommended
- airbnb
- airbnb/hooks
- plugin:@typescript-eslint/recommended
- plugin:react/recommended
- plugin:import/errors
- plugin:import/warnings
- plugin:import/typescript
- prettier
- plugin:@next/next/recommended
rules:
semi: ['error', 'never']
default-case: off
react/jsx-filename-extension: off
# react/jsx-filename-extension: [1, { extensions: ['.ts', '.tsx'] }]
react/jsx-fragments: [1, 'element']
import/extensions: off
import/default: off
no-alert: off
consistent-return: off
react-hooks/exhaustive-deps: off
spaced-comment: off
import/first: off
import/no-extraneous-dependencies: off
import/prefer-default-export: off
import/order: off
react/jsx-key: off
react/button-has-type: off
no-underscore-dangle: off
no-console: off
default-param-last: off
'@typescript-eslint/no-explicit-any': off
'@typescript-eslint/no-empty-function': off
import/no-self-import: off
jsx-a11y/click-events-have-key-events: off
jsx-a11y/no-static-element-interactions: off
no-fallthrough: off
react/no-array-index-key: off
no-new-func: off
import/export: off
react/require-default-props: off
import/no-useless-path-segments: off
import/no-named-as-default: off
import/no-named-as-default-member: off
import/no-relative-packages: off
react/destructuring-assignment: off
'@typescript-eslint/explicit-module-boundary-types': off
react/prop-types: off
react/function-component-definition: off
jsx-a11y/anchor-is-valid: off
react/jsx-props-no-spreading: off
prettier/prettier: warn
react/no-unescaped-entities: off
import/no-cycle: [0, { ignoreExternal: true }]
prefer-const: off
# needed because of https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-use-before-define.md#how-to-use & https://stackoverflow.com/questions/63818415/react-was-used-before-it-was-defined
no-use-before-define: off
import/namespace: off
import/no-unresolved: off
import/no-duplicates: off
'jsx-a11y/label-has-associated-control': off
react/display-name: off
'@typescript-eslint/no-use-before-define':
['error', { functions: false, classes: false, variables: true }]
'@typescript-eslint/ban-ts-comment': off
react/react-in-jsx-scope: off
react/no-unused-prop-types: off
'@next/next/no-img-element': off
react/jsx-no-constructed-context-values: off
'@typescript-eslint/no-unused-vars': off
shortlink/check-author: off
shortlink/check-empty-file: off
settings:
import/resolver:
babel-module:
extensions: ['.js', '.jsx', '.ts', '.tsx']
node:
extensions: ['.js', '.jsx', '.ts', '.tsx']
paths: ['server']
- shortlink
1 change: 0 additions & 1 deletion ui/nx-monorepo/packages/landing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"eslint-config-next": "13.4.4",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-shortlink": "*",
"prettier": "2.8.8",
"schema-dts": "1.1.2"
}
Expand Down
4 changes: 2 additions & 2 deletions ui/nx-monorepo/packages/next/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules/
.next/
.*
node_modules
out
public
94 changes: 1 addition & 93 deletions ui/nx-monorepo/packages/next/.eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -1,94 +1,2 @@
env:
browser: true
node: true
es2021: true
parser: '@typescript-eslint/parser'
parserOptions:
ecmaVersion: 12
sourceType: module
ecmaFeatures:
jsx: true
plugins:
- '@typescript-eslint'
- 'react'
- 'prettier'
extends:
- eslint:recommended
- plugin:react/recommended
- airbnb
- airbnb/hooks
- plugin:@typescript-eslint/recommended
- plugin:react/recommended
- plugin:import/errors
- plugin:import/warnings
- plugin:import/typescript
- prettier
- plugin:@next/next/recommended
rules:
semi: ['error', 'never']
default-case: off
react/jsx-filename-extension: off
# react/jsx-filename-extension: [1, { extensions: ['.ts', '.tsx'] }]
react/jsx-fragments: [1, 'element']
import/extensions: off
import/default: off
no-alert: off
consistent-return: off
react-hooks/exhaustive-deps: off
spaced-comment: off
import/first: off
import/no-extraneous-dependencies: off
import/prefer-default-export: off
import/order: off
react/jsx-key: off
react/button-has-type: off
no-underscore-dangle: off
no-console: off
default-param-last: off
'@typescript-eslint/no-explicit-any': off
'@typescript-eslint/no-empty-function': off
import/no-self-import: off
jsx-a11y/click-events-have-key-events: off
jsx-a11y/no-static-element-interactions: off
no-fallthrough: off
react/no-array-index-key: off
no-restricted-globals: off
no-new-func: off
import/export: off
react/require-default-props: off
import/no-useless-path-segments: off
import/no-named-as-default: off
import/no-named-as-default-member: off
import/no-relative-packages: off
react/destructuring-assignment: off
'@typescript-eslint/explicit-module-boundary-types': off
react/prop-types: off
react/function-component-definition: off
jsx-a11y/anchor-is-valid: off
react/jsx-props-no-spreading: ['error', { custom: 'ignore' }]
prettier/prettier: warn
react/no-unescaped-entities: off
import/no-cycle: [0, { ignoreExternal: true }]
prefer-const: off
# needed because of https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-use-before-define.md#how-to-use & https://stackoverflow.com/questions/63818415/react-was-used-before-it-was-defined
no-use-before-define: off
import/namespace: off
import/no-unresolved: off
import/no-duplicates: off
'jsx-a11y/label-has-associated-control': off
react/display-name: off
'@typescript-eslint/no-use-before-define':
['error', { functions: false, classes: false, variables: true }]
'@typescript-eslint/ban-ts-comment': off
react/react-in-jsx-scope: off
react/no-unused-prop-types: off
'@next/next/no-img-element': off
react/jsx-no-constructed-context-values: off
'@typescript-eslint/no-unused-vars': off
settings:
import/resolver:
babel-module:
extensions: ['.js', '.jsx', '.ts', '.tsx']
node:
extensions: ['.js', '.jsx', '.ts', '.tsx']
paths: ['server']
- shortlink
2 changes: 1 addition & 1 deletion ui/nx-monorepo/packages/ui-kit/.babelrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
"@babel/preset-react"
],
"plugins": []
}
}
4 changes: 4 additions & 0 deletions ui/nx-monorepo/packages/ui-kit/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.*
node_modules
dist
storybook-static
2 changes: 2 additions & 0 deletions ui/nx-monorepo/packages/ui-kit/.eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
extends:
- shortlink
5 changes: 5 additions & 0 deletions ui/nx-monorepo/packages/ui-kit/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "all"
}

0 comments on commit 6adc159

Please sign in to comment.