Skip to content

Commit ae77ee2

Browse files
authored
Merge pull request #275 from krvajal/eslint
Eslint
2 parents 92c6884 + 54bc72f commit ae77ee2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+9289
-6915
lines changed

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.js
2+
test/**/index.ts
3+
test/**/runTest.ts

.eslintrc.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**@type {import('eslint').Linter.Config} */
2+
// eslint-disable-next-line no-undef
3+
module.exports = {
4+
root: true,
5+
parser: '@typescript-eslint/parser',
6+
plugins: ['@typescript-eslint', 'eslint-plugin-jsdoc', 'eslint-plugin-import', 'prettier'],
7+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
8+
rules: {
9+
'semi': [2, 'always'],
10+
'@typescript-eslint/no-unused-vars': 0,
11+
'@typescript-eslint/no-explicit-any': 0,
12+
'@typescript-eslint/explicit-module-boundary-types': 0,
13+
'@typescript-eslint/no-non-null-assertion': 0,
14+
},
15+
};

.github/workflows/main.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
run: yarn install
1717
- name: Compile
1818
run: yarn compile
19+
- name: Linting
20+
run: yarn lint
1921
- name: Test Syntax Highlighting
2022
run: yarn test:grammar
2123
- name: Test Unittests

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# .prettierignore
2+
3+
node_modules
4+
dist
5+
out

.prettierrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"printWidth": 100,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": true,
7+
"jsxSingleQuote": false,
8+
"quoteProps": "consistent",
9+
"trailingComma": "es5",
10+
"bracketSpacing": true,
11+
"jsxBracketSameLine": false,
12+
"arrowParens": "avoid",
13+
"endOfLine": "lf",
14+
"embeddedLanguageFormatting": "auto"
15+
}

.prettierrc.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

.vscode/extensions.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
3+
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4+
// List of extensions which should be recommended for users of this workspace.
5+
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"],
6+
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
7+
"unwantedRecommendations": []
8+
}

.vscode/settings.json

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,33 @@
11
// Place your settings in this file to overwrite default and user settings.
22
{
3-
"files.exclude": {
4-
"out": false // set this to true to hide the "out" folder with the compiled JS files
5-
},
6-
"search.exclude": {
7-
"out": true // set this to false to include "out" folder in search results
8-
}
9-
}
3+
"files.exclude": {
4+
"out": false // set this to true to hide the "out" folder with the compiled JS files
5+
},
6+
"search.exclude": {
7+
"out": true // set this to false to include "out" folder in search results
8+
},
9+
"[typescript]": {
10+
"editor.defaultFormatter": "esbenp.prettier-vscode",
11+
"editor.formatOnSave": true
12+
},
13+
"[javascript]": {
14+
"editor.defaultFormatter": "esbenp.prettier-vscode",
15+
"editor.formatOnSave": true
16+
},
17+
"[json]": {
18+
"editor.defaultFormatter": "esbenp.prettier-vscode",
19+
"editor.formatOnSave": true
20+
},
21+
"[jsonc]": {
22+
"editor.defaultFormatter": "esbenp.prettier-vscode",
23+
"editor.formatOnSave": true
24+
},
25+
"[yaml]": {
26+
"editor.defaultFormatter": "esbenp.prettier-vscode",
27+
"editor.formatOnSave": true
28+
},
29+
"[markdown]": {
30+
"editor.defaultFormatter": "esbenp.prettier-vscode"
31+
},
32+
"prettier.configPath": ".prettierrc"
33+
}

.vscode/tasks.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@
4242
"isDefault": true
4343
},
4444
"detail": "setup for test launch"
45-
45+
},
46+
{
47+
"type": "npm",
48+
"script": "lint",
49+
"problemMatcher": "$eslint-stylish",
50+
"label": "npm: lint",
51+
"detail": "eslint . --ext .ts,.tsx"
4652
}
4753
]
4854
}

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
## [2.4.3]
11+
12+
### Changed
13+
14+
- Changed from `tslint` to `eslint` and `prettier` to format ts, json, md files
15+
([#260](https://github.com/krvajal/vscode-fortran-support/issues/260))
16+
1017
## [2.4.2]
1118

1219
### Fixed
@@ -299,7 +306,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
299306

300307
- Initial release
301308

302-
[unreleased]: https://github.com/krvajal/vscode-fortran-support/compare/v2.4.2...HEAD
309+
[unreleased]: https://github.com/krvajal/vscode-fortran-support/compare/v2.4.3...HEAD
310+
[2.4.3]: https://github.com/krvajal/vscode-fortran-support/compare/v2.4.2...v2.4.3
303311
[2.4.2]: https://github.com/krvajal/vscode-fortran-support/compare/v2.4.1...v2.4.2
304312
[2.4.1]: https://github.com/krvajal/vscode-fortran-support/compare/v2.4.0...v2.4.1
305313
[2.4.0]: https://github.com/krvajal/vscode-fortran-support/compare/v2.3.0...v2.4.0

CONTRIBUTING.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
#CONTRIBUTING
2-
---
3-
You *always* want to look at this file **before** contributing. In here you
1+
# #CONTRIBUTING
2+
3+
You _always_ want to look at this file **before** contributing. In here you
44
should find steps that you need to take to set up your development environment
55
as well as instructions for coding standards and contribution guidelines.
66

7-
87
## Setup instructions
9-
First of all, this is a Visual Studio Code extension that uses TypeScript and tools based on [Node.js](https://nodejs.org/en/) with dependencies from npm. So you will need to have Node installed on your `$PATH`.
8+
9+
First of all, this is a Visual Studio Code extension that uses TypeScript and tools based on [Node.js](https://nodejs.org/en/) with dependencies from npm. So you will need to have Node installed on your `$PATH`.
10+
1011
1. Fork the repo
1112
2. Clone your fork
1213
3. Create a branch
13-
4. Run `npm install`
14-
14+
4. Run `yarn install`
15+
5. To test the extension run `yarn test:grammar && yarn test`

README.md

Lines changed: 35 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -24,36 +24,33 @@
2424

2525
You can control the include paths to be used by the linter with the `fortran.includePaths` setting.
2626

27-
``` jsonc
27+
```jsonc
2828
{
29-
"fortran.includePaths": [
30-
"/usr/local/include",
31-
"/usr/local"
32-
]
29+
"fortran.includePaths": ["/usr/local/include", "/usr/local"]
3330
}
3431
```
3532

3633
By default the `gfortran` executable is assumed to be found in the path. In order to use a different one or if it can't be found in the path you can point the extension to use a custom one with the `fortran.gfortranExecutable` setting.
3734

38-
``` jsonc
35+
```jsonc
3936
{
40-
"fortran.gfortranExecutable": "/usr/local/bin/gfortran-4.7",
37+
"fortran.gfortranExecutable": "/usr/local/bin/gfortran-4.7"
4138
}
4239
```
4340

4441
If you want to pass extra options to the `gfortran` executable or override the default one, you can use the setting `fortran.linterExtraArgs`. By default `-Wall` is the only option.
4542

46-
``` jsonc
43+
```jsonc
4744
{
48-
"fortran.linterExtraArgs": ["-Wall"],
45+
"fortran.linterExtraArgs": ["-Wall"]
4946
}
5047
```
5148

5249
You can configure what kind of symbols will appear in the symbol list by using
5350

54-
``` jsonc
51+
```jsonc
5552
{
56-
"fortran.symbols": [ "function", "subroutine"]
53+
"fortran.symbols": ["function", "subroutine"]
5754
}
5855
```
5956

@@ -69,7 +66,7 @@ and by default only functions and subroutines are shown
6966

7067
You can also configure the case for fortran intrinsics auto-complete by using
7168

72-
``` jsonc
69+
```jsonc
7370
{
7471
"fortran.preferredCase": "lowercase" | "uppercase"
7572
}
@@ -79,7 +76,7 @@ You can also configure the case for fortran intrinsics auto-complete by using
7976

8077
This is a list of some of the snippets included, if you like to include additional snippets please let me know and I will add them.
8178

82-
#### Program skeleton
79+
### Program skeleton
8380

8481
![program snippet](https://media.giphy.com/media/OYdq9BKYMOOdy/giphy.gif)
8582

@@ -110,33 +107,33 @@ More details about how to setup the debugger can be found in Microsoft's website
110107
- C/C++ extension debugger information: <https://code.visualstudio.com/docs/cpp/cpp-debug>
111108
- Build tasks for easy compiling: <https://code.visualstudio.com/docs/editor/tasks>
112109

113-
``` jsonc
110+
```jsonc
114111
{
115-
// Use IntelliSense to learn about possible attributes.
116-
// Hover to view descriptions of existing attributes.
117-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
118-
"version": "0.2.0",
119-
"configurations": [
112+
// Use IntelliSense to learn about possible attributes.
113+
// Hover to view descriptions of existing attributes.
114+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
115+
"version": "0.2.0",
116+
"configurations": [
117+
{
118+
"name": "(gdb) Fortran",
119+
"type": "cppdbg",
120+
"request": "launch",
121+
"program": "${workspaceFolder}/a.out",
122+
"args": [], // Possible input args for a.out
123+
"stopAtEntry": false,
124+
"cwd": "${workspaceFolder}",
125+
"environment": [],
126+
"externalConsole": false,
127+
"MIMode": "gdb",
128+
"setupCommands": [
120129
{
121-
"name": "(gdb) Fortran",
122-
"type": "cppdbg",
123-
"request": "launch",
124-
"program": "${workspaceFolder}/a.out",
125-
"args": [], // Possible input args for a.out
126-
"stopAtEntry": false,
127-
"cwd": "${workspaceFolder}",
128-
"environment": [],
129-
"externalConsole": false,
130-
"MIMode": "gdb",
131-
"setupCommands": [
132-
{
133-
"description": "Enable pretty-printing for gdb",
134-
"text": "-enable-pretty-printing",
135-
"ignoreFailures": true
136-
}
137-
]
130+
"description": "Enable pretty-printing for gdb",
131+
"text": "-enable-pretty-printing",
132+
"ignoreFailures": true
138133
}
139-
]
134+
]
135+
}
136+
]
140137
}
141138
```
142139

@@ -148,7 +145,7 @@ For debugging you need to have one of the following debuggers installed:
148145

149146
- **Linux**: GDB
150147
- **macOS**: GDB or LLDB
151-
- **Windows**: GDB or Visual Studio Windows Debugger
148+
- **Windows**: GDB or Visual Studio Windows Debugger
152149

153150
## Issues
154151

coverconfig.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"enabled": true,
3-
"relativeSourcePath": "../src",
4-
"relativeCoverageDir": "../../coverage",
5-
"ignorePatterns": ["**/node_modules/**"],
6-
"includePid": false,
7-
"reports": ["json", "html", "lcov"],
8-
"verbose": false
9-
}
2+
"enabled": true,
3+
"relativeSourcePath": "../src",
4+
"relativeCoverageDir": "../../coverage",
5+
"ignorePatterns": ["**/node_modules/**"],
6+
"includePid": false,
7+
"reports": ["json", "html", "lcov"],
8+
"verbose": false
9+
}

0 commit comments

Comments
 (0)