Skip to content

Commit 6fb09e0

Browse files
authored
Detect working directory for flat config. (#1815)
1 parent 8173467 commit 6fb09e0

File tree

5 files changed

+1799
-22
lines changed

5 files changed

+1799
-22
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
function bar() {
2+
if (foo) {
3+
foo++;
4+
}
5+
}
6+
7+
function foo(x) {
8+
console.log(x);
9+
bar();
10+
var x = 10;
11+
console.log(undef);
12+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
const globals = require('globals');
2+
const typescriptParser = require('@typescript-eslint/parser');
3+
const typescriptPlugin = require('@typescript-eslint/eslint-plugin');
4+
5+
module.exports = [
6+
"eslint:recommended",
7+
{
8+
files: ["**/*.js"],
9+
languageOptions: {
10+
sourceType: "module",
11+
globals: {
12+
...globals.browser,
13+
...globals.node,
14+
...globals.es6,
15+
...globals.commonjs
16+
}
17+
},
18+
},
19+
{
20+
files: ["sub/*.js"],
21+
rules: {
22+
"no-undef": "warn",
23+
"no-console": "warn"
24+
}
25+
},
26+
{
27+
files: ["*.ts", "**/*.ts"],
28+
plugins: {
29+
"@typescript-eslint": typescriptPlugin
30+
},
31+
languageOptions: {
32+
sourceType: "module",
33+
parser: typescriptParser,
34+
parserOptions: {
35+
project: "./tsconfig.json",
36+
ecmaVersion: 2020
37+
}
38+
},
39+
rules: {
40+
"semi": "off",
41+
"@typescript-eslint/semi": "error",
42+
"no-extra-semi": "warn",
43+
"curly": "warn",
44+
"quotes": ["error", "single", { "allowTemplateLiterals": true } ],
45+
"eqeqeq": "error",
46+
"indent": "off",
47+
"@typescript-eslint/indent": ["warn", "tab", { "SwitchCase": 1 } ],
48+
"@typescript-eslint/no-floating-promises": "error"
49+
}
50+
}
51+
]

0 commit comments

Comments
 (0)