mirror of
				https://gitea.com/actions/setup-python.git
				synced 2025-11-01 04:08:54 +08:00 
			
		
		
		
	Add and configure ESLint and update configuration for Prettier (#617)
* Add ESLint, update Prettier * Update docs * Update tests * Update licenses * Fix review points
This commit is contained in:
		
							
								
								
									
										49
									
								
								.eslintrc.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								.eslintrc.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,49 @@ | ||||
| module.exports = { | ||||
|   extends: [ | ||||
|     'eslint:recommended', | ||||
|     'plugin:@typescript-eslint/recommended', | ||||
|     'plugin:eslint-plugin-jest/recommended', | ||||
|     'eslint-config-prettier' | ||||
|   ], | ||||
|   parser: '@typescript-eslint/parser', | ||||
|   plugins: ['@typescript-eslint', 'eslint-plugin-jest'], | ||||
|   rules: { | ||||
|     '@typescript-eslint/no-require-imports': 'error', | ||||
|     '@typescript-eslint/no-non-null-assertion': 'off', | ||||
|     '@typescript-eslint/no-explicit-any': 'off', | ||||
|     '@typescript-eslint/no-empty-function': 'off', | ||||
|     '@typescript-eslint/ban-ts-comment': [ | ||||
|       'error', | ||||
|       { | ||||
|         'ts-ignore': 'allow-with-description' | ||||
|       } | ||||
|     ], | ||||
|     'no-console': 'error', | ||||
|     'yoda': 'error', | ||||
|     'prefer-const': [ | ||||
|       'error', | ||||
|       { | ||||
|         destructuring: 'all' | ||||
|       } | ||||
|     ], | ||||
|     'no-control-regex': 'off', | ||||
|     'no-constant-condition': ['error', {checkLoops: false}] | ||||
|   }, | ||||
|   overrides: [ | ||||
|     { | ||||
|       files: ['**/*{test,spec}.ts'], | ||||
|       rules: { | ||||
|         '@typescript-eslint/no-unused-vars': 'off', | ||||
|         'jest/no-standalone-expect': 'off', | ||||
|         'jest/no-conditional-expect': 'off', | ||||
|         'no-console': 'off', | ||||
|  | ||||
|       } | ||||
|     } | ||||
|   ], | ||||
|   env: { | ||||
|     node: true, | ||||
|     es6: true, | ||||
|     'jest/globals': true | ||||
|   } | ||||
| }; | ||||
		Reference in New Issue
	
	Block a user
	 Ivan
					Ivan