Skip to content

Commit 3551102

Browse files
authored
Slang 0.17.0 (#1043)
* updating to slang 0.17.0 and the new AST * updating solc * updating eslint * running lint with node 18
1 parent e5d506d commit 3551102

39 files changed

+565
-1761
lines changed

.eslintignore

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

.eslintrc

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

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: actions/checkout@v3
1717
- uses: actions/setup-node@v3
1818
with:
19-
node-version: 16
19+
node-version: 18
2020
cache: 'npm'
2121
- name: Install
2222
run: npm install

eslint.config.mjs

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
import globals from 'globals';
2+
import typescriptEslint from '@typescript-eslint/eslint-plugin';
3+
import tsParser from '@typescript-eslint/parser';
4+
import path from 'node:path';
5+
import { fileURLToPath } from 'node:url';
6+
import js from '@eslint/js';
7+
import { FlatCompat } from '@eslint/eslintrc';
8+
9+
const __filename = fileURLToPath(import.meta.url);
10+
const __dirname = path.dirname(__filename);
11+
const compat = new FlatCompat({
12+
baseDirectory: __dirname,
13+
recommendedConfig: js.configs.recommended,
14+
allConfig: js.configs.all
15+
});
16+
17+
export default [
18+
{
19+
ignores: [
20+
'coverage/**/*.js',
21+
'dist/**/*.cjs',
22+
'dist/**/*.js',
23+
'tests/**/*.snap',
24+
'tests/format/**/*.sol',
25+
'tests/format/Markdown/Markdown.md',
26+
'tests/format/RespectDefaultOptions/respect-default-options.js',
27+
'tests/config/**/*.*js',
28+
'src/prettier-comments/**/*.js'
29+
]
30+
},
31+
{
32+
languageOptions: {
33+
globals: {
34+
...globals.jest,
35+
runFormatTest: 'readonly'
36+
}
37+
},
38+
39+
rules: {
40+
'no-console': [
41+
'warn',
42+
{
43+
allow: ['warn']
44+
}
45+
]
46+
}
47+
},
48+
...compat
49+
.extends(
50+
'prettier',
51+
'plugin:@typescript-eslint/recommended',
52+
'plugin:@typescript-eslint/stylistic',
53+
'plugin:@typescript-eslint/recommended-type-checked'
54+
)
55+
.map((config) => ({
56+
...config,
57+
files: ['**/*.ts']
58+
})),
59+
{
60+
files: ['**/*.ts'],
61+
62+
plugins: {
63+
'@typescript-eslint': typescriptEslint
64+
},
65+
66+
languageOptions: {
67+
parser: tsParser,
68+
ecmaVersion: 5,
69+
sourceType: 'script',
70+
71+
parserOptions: {
72+
project: ['tsconfig.json']
73+
}
74+
},
75+
76+
rules: {
77+
'@typescript-eslint/explicit-function-return-type': 'error'
78+
}
79+
},
80+
...compat.extends('prettier').map((config) => ({
81+
...config,
82+
files: ['**/*.*js']
83+
})),
84+
{
85+
files: ['**/*.*js'],
86+
87+
languageOptions: {
88+
ecmaVersion: 'latest',
89+
sourceType: 'module'
90+
}
91+
}
92+
];

0 commit comments

Comments
 (0)