Skip to content
Snippets Groups Projects
Unverified Commit 30b44adb authored by Konstantin Tsabolov's avatar Konstantin Tsabolov
Browse files

chore: move ESLint to the root

parent 56b112a8
No related branches found
No related tags found
2 merge requests!9feat(ssi): Establish a trusted connection with yourself,!8Project house-keeping, refactoring and reorganizing
# Ignore everything
*
# Except these files
!*.ts
!*.d.ts
# .. also in subdirectories
!*/
# ... in these directories
!apps/**/src/*
# Explicitly ignore these locations
node_modules
apps/**/dist
compose
documentation
# Ignore ssi-abstraction for now
apps/ssi-abstraction
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:@typescript-eslint/recommended',
'plugin:workspaces/recommended',
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
plugins: ['workspaces'],
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.eslint.json'],
},
settings: {
'import/extensions': ['.js', '.ts'],
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
project: 'packages/*/tsconfig.json',
alwaysTryTypes: true,
},
},
},
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-use-before-define': ['error', { functions: false, classes: false, variables: true }],
'@typescript-eslint/explicit-member-accessibility': 'error',
'no-console': 'error',
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-floating-promises': 'error',
'import/no-cycle': 'error',
'import/newline-after-import': ['error', { count: 1 }],
'import/order': [
'error',
{
groups: ['type', ['builtin', 'external'], 'parent', 'sibling', 'index'],
alphabetize: {
order: 'asc',
},
'newlines-between': 'always',
},
],
'@typescript-eslint/no-non-null-assertion': 'error',
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: false,
},
],
'no-restricted-imports': [
'error',
{
patterns: ['packages/*'],
},
],
// Do not allow const enums
// https://github.com/typescript-eslint/typescript-eslint/issues/561#issuecomment-593059472
// https://ncjamieson.com/dont-export-const-enums/
'no-restricted-syntax': [
'error',
{
selector: 'TSEnumDeclaration[const=true]',
message: "Don't declare const enums",
},
],
},
overrides: [
{
files: [
'*.spec.ts',
'*.e2e-spec.ts',
'**/tests/**',
],
env: {
jest: true,
node: false,
},
rules: {
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
},
],
},
}
]
}
......@@ -9,11 +9,20 @@
"principal:build": "pnpm -F principal-manager build",
"proof:build": "pnpm -F proof-manager build",
"ssi:build": "pnpm -F ssi-abstraction build",
"lint": "pnpm -r lint",
"lint": "eslint --fix",
"lint:all": "npm run lint -- .",
"format": "prettier --write",
"format:all": "npm run format -- ."
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.11.0",
"@typescript-eslint/parser": "^6.11.0",
"eslint": "^8.54.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-workspaces": "^0.9.0",
"prettier": "^3.1.0"
}
}
This diff is collapsed.
{
"extends": "./tsconfig.json",
"include": ["apps", "./.eslintrc.js"],
"exclude": ["node_modules", "**/dist/**"]
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment