Skip to content

Commit

Permalink
fix: remove project-specific settings
Browse files Browse the repository at this point in the history
  • Loading branch information
tksst committed Jul 31, 2022
1 parent 5a43611 commit ee36d39
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 44 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ module.exports = {
node: true,
jest: true
},
parserOptions: {
// Your project environment settings here.
// See ESLint document of "Specifying Parser Options":
// https://eslint.org/docs/latest/user-guide/configuring/language-options#specifying-parser-options

// example:
sourceType: "module",
}
extends: "@tksst/eslint-config"
};
```
Expand Down
25 changes: 3 additions & 22 deletions __snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,12 @@

exports[`ESLint config Snapshot for JavaScript 1`] = `
Object {
"env": Object {
"es6": true,
"node": true,
},
"env": Object {},
"globals": Object {},
"ignorePatterns": Array [],
"noInlineConfig": undefined,
"parser": null,
"parserOptions": Object {
"ecmaFeatures": Object {
"generators": false,
"objectLiteralDuplicateProperties": false,
},
"ecmaVersion": 2018,
"sourceType": "module",
},
"parserOptions": Object {},
"plugins": Array [
"simple-import-sort",
"import",
Expand Down Expand Up @@ -903,22 +893,13 @@ Object {

exports[`ESLint config Snapshot for TypeScript 1`] = `
Object {
"env": Object {
"es6": true,
"node": true,
},
"env": Object {},
"globals": Object {},
"ignorePatterns": Array [],
"noInlineConfig": undefined,
"parser": "node_modules/@typescript-eslint/parser/dist/index.js",
"parserOptions": Object {
"ecmaFeatures": Object {
"generators": false,
"objectLiteralDuplicateProperties": false,
},
"ecmaVersion": 2018,
"project": "./tsconfig.json",
"sourceType": "module",
},
"plugins": Array [
"@typescript-eslint",
Expand Down
14 changes: 2 additions & 12 deletions src/__snapshots__/javascript.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,12 @@

exports[`ESLint config Snapshot for JavaScript 1`] = `
Object {
"env": Object {
"es6": true,
"node": true,
},
"env": Object {},
"globals": Object {},
"ignorePatterns": Array [],
"noInlineConfig": undefined,
"parser": null,
"parserOptions": Object {
"ecmaFeatures": Object {
"generators": false,
"objectLiteralDuplicateProperties": false,
},
"ecmaVersion": 2018,
"sourceType": "module",
},
"parserOptions": Object {},
"plugins": Array [
"simple-import-sort",
"import",
Expand Down
11 changes: 1 addition & 10 deletions src/__snapshots__/typescript.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,13 @@

exports[`ESLint config Snapshot for TypeScript 1`] = `
Object {
"env": Object {
"es6": true,
"node": true,
},
"env": Object {},
"globals": Object {},
"ignorePatterns": Array [],
"noInlineConfig": undefined,
"parser": "node_modules/@typescript-eslint/parser/dist/index.js",
"parserOptions": Object {
"ecmaFeatures": Object {
"generators": false,
"objectLiteralDuplicateProperties": false,
},
"ecmaVersion": 2018,
"project": "./tsconfig.json",
"sourceType": "module",
},
"plugins": Array [
"@typescript-eslint",
Expand Down
6 changes: 6 additions & 0 deletions src/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ function trimRules(conf) {
const result = await eslint.calculateConfigForFile("./test.js");
trimRules(result);
result.ignorePatterns = undefined;
result.parserOptions = undefined;
result.env = undefined;
await fs.writeFile("./dist/javascript.json", JSON.stringify(result));
})();

Expand All @@ -36,6 +38,10 @@ function trimRules(conf) {
const result = await eslint.calculateConfigForFile("./test.ts");
trimRules(result);
result.ignorePatterns = undefined;
result.parserOptions.ecmaVersion = undefined;
result.parserOptions.ecmaFeatures = undefined;
result.parserOptions.sourceType = undefined;
result.env = undefined;
result.parser = "@typescript-eslint/parser";
await fs.writeFile("./dist/typescript.json", JSON.stringify(result));
})();

0 comments on commit ee36d39

Please sign in to comment.