diff --git a/index.js b/index.js index d2600be..956b277 100644 --- a/index.js +++ b/index.js @@ -21,7 +21,7 @@ module.exports = { "sourceType": "module" }, "plugins": ["prettier", "only-warn"], - "extends": ["prettier", "eslint:recommended", "plugin:react/recommended"], + "extends": ["prettier", "eslint:recommended"], "ignorePatterns": ["node_modules/"], "overrides": [ { diff --git a/react.js b/react.js new file mode 100644 index 0000000..3d3e3ae --- /dev/null +++ b/react.js @@ -0,0 +1,82 @@ +module.exports = { + // JS Files + "root": true, + "env": { + "atomtest": true, + "es6": true, + "node": true, + "browser": true, + "jasmine": true + }, + "globals": { + "atom": "readonly", + "measure": "readonly" + }, + "parser": "babel-eslint", + "parserOptions": { + "ecmaFeatures": { + "jsx": true + }, + "ecmaVersion": 2018, + "sourceType": "module" + }, + "plugins": ["prettier", "react", "only-warn"], + "extends": ["prettier", "eslint:recommended", "plugin:react/recommended"], + "ignorePatterns": ["node_modules/"], + "overrides": [ + { + // Bundled node version with atom has an old ESLint + // TypeScript files + "files": ["**/*.ts", "**/*.tsx"], + "parser": "@typescript-eslint/parser", + "plugins": ["prettier", "react", "@typescript-eslint", "only-warn"], + "extends": [ + "prettier", + "prettier/@typescript-eslint", + "eslint:recommended", + "plugin:react/recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended" + ], + "rules": { + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/camelcase": "off", + "@typescript-eslint/no-use-before-define": "off", + "@typescript-eslint/member-delimiter-style": "off" + } + }, + { + // JSON files + "files": ["*.json"], + "plugins": ["json"], + "extends": ["prettier", "plugin:json/recommended"], + "rules": { + "json/*": [ + "error", + { + "allowComments": true + } + ] + } + }, + { + // CoffeeScript files + "files": ["**/*.coffee"], + "parser": "eslint-plugin-coffee", + "plugins": ["coffee", "only-warn"], + "extends": ["plugin:coffee/eslint-recommended"] + }, + { + // YAML files + "files": ["*.yaml", "*.yml"], + "plugins": ["yaml"], + "extends": ["plugin:yaml/recommended"] + } + ], + "settings": { + "react": { + "version": "detect" + } + } +} diff --git a/strict-react.js b/strict-react.js new file mode 100644 index 0000000..adca357 --- /dev/null +++ b/strict-react.js @@ -0,0 +1,82 @@ +module.exports = { + // JS Files + "root": true, + "env": { + "atomtest": true, + "es6": true, + "node": true, + "browser": true, + "jasmine": true + }, + "globals": { + "atom": "readonly", + "measure": "readonly" + }, + "parser": "babel-eslint", + "parserOptions": { + "ecmaFeatures": { + "jsx": true + }, + "ecmaVersion": 2018, + "sourceType": "module" + }, + "plugins": ["prettier", "react"], + "extends": ["prettier", "eslint:recommended", "plugin:react/recommended"], + "ignorePatterns": ["node_modules/"], + "overrides": [ + { + // Bundled node version with atom has an old ESLint + // TypeScript files + "files": ["**/*.ts", "**/*.tsx"], + "parser": "@typescript-eslint/parser", + "plugins": ["prettier", "react", "@typescript-eslint"], + "extends": [ + "prettier", + "prettier/@typescript-eslint", + "eslint:recommended", + "plugin:react/recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended" + ], + "rules": { + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/camelcase": "off", + "@typescript-eslint/no-use-before-define": "off", + "@typescript-eslint/member-delimiter-style": "off" + } + }, + { + // JSON files + "files": ["*.json"], + "plugins": ["json"], + "extends": ["prettier", "plugin:json/recommended"], + "rules": { + "json/*": [ + "error", + { + "allowComments": true + } + ] + } + }, + { + // CoffeeScript files + "files": ["**/*.coffee"], + "parser": "eslint-plugin-coffee", + "plugins": ["coffee"], + "extends": ["plugin:coffee/eslint-recommended"] + }, + { + // YAML files + "files": ["*.yaml", "*.yml"], + "plugins": ["yaml"], + "extends": ["plugin:yaml/recommended"] + } + ], + "settings": { + "react": { + "version": "detect" + } + } +} diff --git a/strict.js b/strict.js index 94f8241..81f5c56 100644 --- a/strict.js +++ b/strict.js @@ -21,7 +21,7 @@ module.exports = { "sourceType": "module" }, "plugins": ["prettier"], - "extends": ["prettier", "eslint:recommended", "plugin:react/recommended"], + "extends": ["prettier", "eslint:recommended"], "ignorePatterns": ["node_modules/"], "overrides": [ {