diff --git a/.circleci/config.yml b/.circleci/config.yml index d6f50a5..6b54c97 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -85,6 +85,11 @@ jobs: cd ./example-site/ node ./../src/cli.js ci name: Run test - ci install projects + - run: + command: | + cd ./example-site/ + node ./../src/cli.js build standards --once + name: Run test - Compile Standards Plugin - run: command: | cd ./example-site/ diff --git a/configs/eslint.js b/configs/eslint.js index 7ea1f89..b59de29 100644 --- a/configs/eslint.js +++ b/configs/eslint.js @@ -13,7 +13,7 @@ module.exports = { es2021: true, node: true, }, - extends: ['airbnb', 'prettier'], + extends: ['airbnb', 'prettier', 'plugin:@typescript-eslint/recommended'], parser: '@babel/eslint-parser', parserOptions: { requireConfigFile: false, @@ -25,51 +25,48 @@ module.exports = { es2021: true, node: true, }, - extends: ['airbnb', 'prettier', 'plugin:@typescript-eslint/recommended'], - parser: '@babel/eslint-parser', - parserOptions: { - requireConfigFile: false, - babelOptions: { - ...babelConfig, - }, - }, - plugins: ['@babel', 'react', 'prettier', 'jsdoc', 'import', '@typescript-eslint/eslint-plugin'], settings: { 'import/resolver': eslintResolver(), 'import/parsers': { '@typescript-eslint/parser': ['.ts', '.tsx'], }, }, - rules: { - complexity: ['error', 10], - 'prettier/prettier': 'error', - 'import/no-extraneous-dependencies': [ - 'error', - { - devDependencies: true, - }, - ], - 'react/jsx-uses-react': 'error', - 'react/jsx-uses-vars': 'error', - 'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx', '.ts', '.tsx'] }], - 'react/react-in-jsx-scope': 0, - 'react/prop-types': 0, - 'react/forbid-prop-types': 0, - 'react/require-default-props': 0, - 'arrow-parens': 2, - 'jsdoc/require-jsdoc': [ - 'error', - { - require: { - ArrowFunctionExpression: true, - ClassDeclaration: true, - ClassExpression: true, - FunctionDeclaration: true, - FunctionExpression: true, - MethodDefinition: true, - }, + }, + plugins: ['@babel', 'react', 'prettier', 'jsdoc', 'import', '@typescript-eslint/eslint-plugin'], + rules: { + complexity: ['error', 10], + 'prettier/prettier': 'error', + 'import/no-extraneous-dependencies': [ + 'error', + { + devDependencies: true, + }, + ], + 'react/jsx-uses-react': 'error', + 'react/jsx-uses-vars': 'error', + 'react/jsx-filename-extension': [ + 1, + { + extensions: ['.js', '.jsx', '.ts', '.tsx'] + } + ], + 'react/react-in-jsx-scope': 0, + 'react/prop-types': 0, + 'react/forbid-prop-types': 0, + 'react/require-default-props': 0, + 'arrow-parens': 2, + 'jsdoc/require-jsdoc': [ + 'error', + { + require: { + ArrowFunctionExpression: true, + ClassDeclaration: true, + ClassExpression: true, + FunctionDeclaration: true, + FunctionExpression: true, + MethodDefinition: true, }, - ], - }, - } -}; + }, + ], + }, +}; \ No newline at end of file diff --git a/example-site/package.json b/example-site/package.json index d71af10..1d39084 100644 --- a/example-site/package.json +++ b/example-site/package.json @@ -1,5 +1,6 @@ { "name": "test-project", + "prettier": "./../configs/prettier", "eslintConfig": { "extends": "./../configs/eslint" }, diff --git a/example-site/plugins/standards/inc/.gitkeep b/example-site/plugins/standards/inc/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/example-site/plugins/standards/package-lock.json b/example-site/plugins/standards/package-lock.json new file mode 100644 index 0000000..46f9809 --- /dev/null +++ b/example-site/plugins/standards/package-lock.json @@ -0,0 +1,11 @@ +{ + "name": "standards", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "standards", + "devDependencies": {} + } + } +} diff --git a/example-site/plugins/standards/package.json b/example-site/plugins/standards/package.json new file mode 100644 index 0000000..49f9e76 --- /dev/null +++ b/example-site/plugins/standards/package.json @@ -0,0 +1,9 @@ +{ + "name": "standards", + "prettier": "./../../../configs/prettier", + "eslintConfig": { + "extends": "./../../../configs/eslint" + }, + "dependencies": {}, + "devDependencies": {} +} diff --git a/example-site/plugins/standards/src/entrypoints/jsx-standards.js b/example-site/plugins/standards/src/entrypoints/jsx-standards.js new file mode 100644 index 0000000..e76d507 --- /dev/null +++ b/example-site/plugins/standards/src/entrypoints/jsx-standards.js @@ -0,0 +1,15 @@ +/** + * A simple example for reproducing incorrect JSX issues + * in ESLint: + * - react/react-in-jsx-scope + * - react/jsx-filename-extension + */ +export default () => ( +