-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(*): Fix eslint configs #2140
Changes from all commits
909f743
64327d4
af8f8fa
10010d8
443e6b8
7e954ee
143946f
68c313b
fb6973e
c21846e
ff91627
5c600e9
1cc5f1c
5bc9d25
e9dfbb7
6f5adb2
5ce4ed4
842f7e2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
{ | ||
// Fixes tsconfig not found error in nested .eslintrc.json files with relative paths | ||
"eslint.workingDirectories": ["packages/intranet-header-workspace"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
src/components/stencil-generated |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,28 @@ | ||
{ | ||
"env": { | ||
"es2021": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:react/recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"overrides": [ | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"react", | ||
"@typescript-eslint" | ||
], | ||
"rules": { | ||
"env": { | ||
"es2021": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:react/recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"overrides": [ | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"react", | ||
"@typescript-eslint" | ||
], | ||
"settings": { | ||
"react": { | ||
"version": "detect" | ||
} | ||
}, | ||
"rules": { | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,8 @@ | |
dist | ||
loader | ||
www | ||
.stencil | ||
cypress | ||
stencil.config.ts | ||
cypress.config.js | ||
.eslintrc.js |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
node: true, | ||
es2021: true, | ||
}, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:@stencil-community/recommended', | ||
], | ||
overrides: [], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
tsconfigRootDir: __dirname, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Convert to js to be able to use |
||
project: 'tsconfig.eslint.json', | ||
}, | ||
plugins: ['@typescript-eslint'], | ||
rules: { | ||
'indent': [ | ||
'error', | ||
2, | ||
{ | ||
SwitchCase: 1, | ||
}, | ||
], | ||
'quotes': ['error', 'single'], | ||
'semi': ['error', 'always'], | ||
'@typescript-eslint/no-unused-vars': [ | ||
'error', | ||
{ | ||
caughtErrors: 'none', | ||
destructuredArrayIgnorePattern: '^_', | ||
ignoreRestSiblings: true, | ||
}, | ||
], | ||
'@stencil-community/strict-boolean-conditions': 'off', | ||
'@stencil-community/required-prefix': ['error', ['post-']], | ||
'@stencil-community/async-methods': 'error', | ||
'@stencil-community/decorators-context': 'error', | ||
'@stencil-community/decorators-style': [ | ||
'error', | ||
{ | ||
prop: 'inline', | ||
state: 'inline', | ||
element: 'inline', | ||
event: 'inline', | ||
method: 'multiline', | ||
watch: 'multiline', | ||
listen: 'multiline', | ||
}, | ||
], | ||
'@stencil-community/class-pattern': [ | ||
'error', | ||
{ | ||
pattern: '^Post.*(?!Component)$', | ||
}, | ||
], | ||
'@stencil-community/element-type': 'error', | ||
'@stencil-community/host-data-deprecated': 'error', | ||
'@stencil-community/methods-must-be-public': 'error', | ||
'@stencil-community/no-unused-watch': 'error', | ||
'@stencil-community/own-methods-must-be-private': 'error', | ||
'@stencil-community/own-props-must-be-private': 'error', | ||
'@stencil-community/prefer-vdom-listener': 'error', | ||
'@stencil-community/props-must-be-public': 'error', | ||
'@stencil-community/props-must-be-readonly': 'error', | ||
'@stencil-community/render-returns-host': 'error', | ||
'@stencil-community/required-jsdoc': 'error', | ||
'@stencil-community/reserved-member-names': 'error', | ||
'@stencil-community/single-export': 'error', | ||
'@stencil-community/strict-mutable': 'error', | ||
'react/jsx-no-bind': 'off', | ||
}, | ||
}; |
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,10 +1,5 @@ | ||||||
{ | ||||||
"extends": "./tsconfig.json", | ||||||
"include": [ | ||||||
"src", | ||||||
"**/tests" | ||||||
], | ||||||
"exclude": [ | ||||||
"node_modules" | ||||||
] | ||||||
"include": ["src", "**/tests"], | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another error says that the eslint config file is not linted.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I cannot reproduce it. Where does the error appear? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It only appears when the above suggestion is applied, so it will be fixed with #2167 |
||||||
"exclude": ["node_modules"] | ||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.angular | ||
dist |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,41 @@ | ||
module.exports = { | ||
"root": true, | ||
"ignorePatterns": [ | ||
"projects/**/*" | ||
], | ||
"overrides": [ | ||
root: true, | ||
ignorePatterns: ['projects/**/*'], | ||
overrides: [ | ||
{ | ||
"files": [ | ||
"*.ts" | ||
], | ||
"parserOptions": { | ||
"project": [ | ||
"tsconfig.json" | ||
], | ||
"tsconfigRootDir": __dirname, | ||
"createDefaultProgram": true | ||
files: ['*.ts'], | ||
parserOptions: { | ||
project: ['tsconfig.json'], | ||
tsconfigRootDir: __dirname, | ||
createDefaultProgram: true, | ||
}, | ||
"extends": [ | ||
"plugin:@angular-eslint/recommended", | ||
"plugin:@angular-eslint/template/process-inline-templates" | ||
extends: [ | ||
'plugin:@angular-eslint/recommended', | ||
'plugin:@angular-eslint/template/process-inline-templates', | ||
], | ||
"rules": { | ||
"@angular-eslint/directive-selector": [ | ||
"error", | ||
rules: { | ||
'@angular-eslint/directive-selector': [ | ||
'error', | ||
{ | ||
"type": "attribute", | ||
"prefix": "app", | ||
"style": "camelCase" | ||
} | ||
type: 'attribute', | ||
prefix: 'app', | ||
style: 'camelCase', | ||
}, | ||
], | ||
"@angular-eslint/component-selector": [ | ||
"error", | ||
'@angular-eslint/component-selector': [ | ||
'error', | ||
{ | ||
"type": "element", | ||
"prefix": "app", | ||
"style": "kebab-case" | ||
} | ||
] | ||
} | ||
type: 'element', | ||
prefix: 'app', | ||
style: 'kebab-case', | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
"files": [ | ||
"*.html" | ||
], | ||
"extends": [ | ||
"plugin:@angular-eslint/template/recommended" | ||
], | ||
"rules": {} | ||
} | ||
] | ||
} | ||
files: ['*.html'], | ||
extends: ['plugin:@angular-eslint/template/recommended'], | ||
rules: {}, | ||
}, | ||
], | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.stencil | ||
loader | ||
www | ||
dist | ||
node_modules | ||
stencil.config.ts | ||
cypress.config.js | ||
jest.config.js | ||
src/assets | ||
.eslintrc.js |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module.exports = { | ||
extends: ['plugin:@stencil-community/recommended'], | ||
parserOptions: { | ||
sourceType: 'module', | ||
ecmaVersion: 2020, | ||
tsconfigRootDir: __dirname, | ||
project: 'tsconfig.eslint.json', | ||
}, | ||
rules: { | ||
'@stencil-community/element-type': 1, | ||
// Needed for DropdownElement | ||
'@stencil/decorators-context': 0, | ||
// This is a broken rule with eslint 8 (https://github.com/stencil-community/stencil-eslint/issues/60) | ||
'@stencil/own-methods-must-be-private': 0, | ||
// Seems to be buggy as well | ||
'@stencil/async-methods': 0, | ||
// Also buggy | ||
'@stencil/no-unused-watch': 0, | ||
// Buggy | ||
'react/jsx-no-bind': 0, | ||
// No performance problem anymore https://medium.com/@ryanflorence/react-inline-functions-and-performance-bdff784f5578 | ||
}, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got an error that this file can be converted to an es module (the automatic migration does not work, but export default works for me)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, it's not as easy as that. I think the error only appears in your IDE, but not the tools. We need to make a lot of changes so I created another ticket for that: #2167